The following commit has been merged in the master branch:
commit 812115a0f521f971c6f7ca77a8a8646f4b931435
Author: Guillem Jover <[email protected]>
Date:   Fri Feb 5 19:58:26 2010 +0100

    libdpkg: Add and use new DPKG_ATTR_VPRINTF
    
    This new attribute marks a function that uses format strings with a
    va_list argument.

diff --git a/lib/dpkg/dpkg.h b/lib/dpkg/dpkg.h
index 7306930..584e1ab 100644
--- a/lib/dpkg/dpkg.h
+++ b/lib/dpkg/dpkg.h
@@ -153,7 +153,7 @@ void do_internerr(const char *file, int line, const char 
*fmt, ...)
 #endif
 
 void ohshit(const char *fmt, ...) DPKG_ATTR_NORET DPKG_ATTR_PRINTF(1);
-void ohshitv(const char *fmt, va_list al) DPKG_ATTR_NORET;
+void ohshitv(const char *fmt, va_list al) DPKG_ATTR_NORET DPKG_ATTR_VPRINTF(1);
 void ohshite(const char *fmt, ...) DPKG_ATTR_NORET DPKG_ATTR_PRINTF(1);
 void werr(const char *what) DPKG_ATTR_NORET;
 void warning(const char *fmt, ...) DPKG_ATTR_PRINTF(1);
diff --git a/lib/dpkg/macros.h b/lib/dpkg/macros.h
index 830fc72..5b1c3a2 100644
--- a/lib/dpkg/macros.h
+++ b/lib/dpkg/macros.h
@@ -28,6 +28,7 @@
 #define DPKG_ATTR_CONST                __attribute__((const))
 #define DPKG_ATTR_NORET                __attribute__((noreturn))
 #define DPKG_ATTR_PRINTF(n)    __attribute__((format(printf, n, n + 1)))
+#define DPKG_ATTR_VPRINTF(n)   __attribute__((format(printf, n, 0)))
 #define DPKG_ATTR_SENTINEL     __attribute__((sentinel))
 #else
 #define DPKG_ATTR_UNUSED
diff --git a/lib/dpkg/varbuf.h b/lib/dpkg/varbuf.h
index 1107da8..f866afb 100644
--- a/lib/dpkg/varbuf.h
+++ b/lib/dpkg/varbuf.h
@@ -77,7 +77,8 @@ void varbufsubstc(struct varbuf *v, int c_src, int c_dst);
 void varbufaddbuf(struct varbuf *v, const void *s, size_t size);
 
 int varbufprintf(struct varbuf *v, const char *fmt, ...) DPKG_ATTR_PRINTF(2);
-int varbufvprintf(struct varbuf *v, const char *fmt, va_list va);
+int varbufvprintf(struct varbuf *v, const char *fmt, va_list va)
+       DPKG_ATTR_VPRINTF(2);
 
 DPKG_END_DECLS
 

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to