From fdeeb6f8547617a0478ffe847b76c46fa45487d0 Mon Sep 17 00:00:00 2001 From: Guillaume Nault Date: Tue, 4 Sep 2012 20:29:08 +0200 Subject: Add compilation checks for printf-style format strings Append the format() __attribute__ to function prototypes which use a format string. This allows GCC to check for consistency between the format string and its arguments when these functions are called. Signed-off-by: Guillaume Nault --- accel-pppd/triton/triton_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'accel-pppd/triton') diff --git a/accel-pppd/triton/triton_p.h b/accel-pppd/triton/triton_p.h index 2eb2e62a..443cedea 100644 --- a/accel-pppd/triton/triton_p.h +++ b/accel-pppd/triton/triton_p.h @@ -104,8 +104,8 @@ int triton_queue_ctx(struct _triton_context_t*); void triton_thread_wakeup(struct _triton_thread_t*); int conf_load(const char *fname); int conf_reload(const char *fname); -void triton_log_error(const char *fmt,...); -void triton_log_debug(const char *fmt,...); +void triton_log_error(const char *fmt, ...) __attribute__((format(gnu_printf, 1, 2))); +void triton_log_debug(const char *fmt, ...) __attribute__((format(gnu_printf, 1, 2))); int load_modules(const char *name); #endif -- cgit v1.2.3