[spice-common 4/8] build: Add missing G_GNUC_PRINTF annotations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



They were suggested by gcc when using -Wsuggest-attribute=format

Signed-off-by: Christophe Fergeau <cfergeau@xxxxxxxxxx>
---
 common/log.c         | 13 +++++++------
 tests/test-logging.c |  1 +
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/common/log.c b/common/log.c
index b73da71..7cb3e36 100644
--- a/common/log.c
+++ b/common/log.c
@@ -33,12 +33,13 @@ SPICE_CONSTRUCTOR_FUNC(spice_log_init)
     recorder_dump_on_common_signals(0, 0);
 }
 
-static void spice_logv(const char *log_domain,
-                       GLogLevelFlags log_level,
-                       const char *strloc,
-                       const char *function,
-                       const char *format,
-                       va_list args)
+static G_GNUC_PRINTF(5, 0)
+void spice_logv(const char *log_domain,
+                GLogLevelFlags log_level,
+                const char *strloc,
+                const char *function,
+                const char *format,
+                va_list args)
 {
     GString *log_msg;
 
diff --git a/tests/test-logging.c b/tests/test-logging.c
index 6a79ca9..32b0c33 100644
--- a/tests/test-logging.c
+++ b/tests/test-logging.c
@@ -27,6 +27,7 @@
 
 #define OTHER_LOG_DOMAIN "Other"
 #define LOG_OTHER_HELPER(suffix, level)                                          \
+    G_GNUC_PRINTF(1, 2)                                                          \
     static void G_PASTE(other_, suffix)(const gchar *format, ...)                \
     {                                                                            \
         va_list args;                                                            \
-- 
2.21.0

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]