From 81ffaa04b9c17f868844294aa107155f397650f2 Mon Sep 17 00:00:00 2001 From: Bill Spitzak Date: Sun, 18 Mar 2012 18:54:21 -0700 Subject: [PATCH] Check arguments to wl_resource_post_error in gcc The attached patch turns on printf argument warnings for this function, which I found was being called incorrectly at least once in the wayland source code. --- src/wayland-server.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wayland-server.h b/src/wayland-server.h index 4293536..2072827 100644 --- a/src/wayland-server.h +++ b/src/wayland-server.h @@ -262,7 +262,8 @@ void wl_resource_queue_event(struct wl_resource *resource, /* msg is a printf format string, variable args are its args. */ void wl_resource_post_error(struct wl_resource *resource, - uint32_t code, const char *msg, ...); + uint32_t code, const char *msg, ...) + __attribute__ ((format (printf, 3, 4))); void wl_resource_post_no_memory(struct wl_resource *resource); #include "wayland-server-protocol.h" -- 2.7.4