summaryrefslogtreecommitdiffstats
path: root/common/log.h
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2012-02-10 14:30:56 +0000
committerMarc-André Lureau <marcandre.lureau@gmail.com>2012-03-20 15:30:24 +0100
commit985ec9d6ec56f15a72ec974ff2fd1f7bab68cd91 (patch)
treee03feb7a4ef36761c2c03b4f39ee900d0f02c8fa /common/log.h
parent9f7d6175e7f8af3cb8b3556affe04d49d35be663 (diff)
downloadspice-common-985ec9d6ec56f15a72ec974ff2fd1f7bab68cd91.tar.gz
spice-common-985ec9d6ec56f15a72ec974ff2fd1f7bab68cd91.tar.xz
spice-common-985ec9d6ec56f15a72ec974ff2fd1f7bab68cd91.zip
Add printf format annotations to all '...' functions
To allow the compile to detect incorrect printf formats, any var-args function should have a format annotation * common/macros.h: Helper to define ATTR_PRINTF for code which can't depend on glib * common/canvas_base.c, common/lz.h, common/macros.h: Annotate some var-args methods
Diffstat (limited to 'common/log.h')
-rw-r--r--common/log.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/log.h b/common/log.h
index 949879e..37c491f 100644
--- a/common/log.h
+++ b/common/log.h
@@ -20,6 +20,7 @@
#include <spice/macros.h>
#include <stdarg.h>
+#include "macros.h"
SPICE_BEGIN_DECLS
@@ -45,14 +46,14 @@ void spice_logv(const char *log_domain,
const char *strloc,
const char *function,
const char *format,
- va_list args);
+ va_list args) SPICE_ATTR_PRINTF(5, 0);
void spice_log(const char *log_domain,
SpiceLogLevel log_level,
const char *strloc,
const char *function,
const char *format,
- ...);
+ ...) SPICE_ATTR_PRINTF(5, 6);
#ifndef spice_return_if_fail
#define spice_return_if_fail(x) SPICE_STMT_START { \