[totem] screenshot: Attempt to silence warnings about printf() formatting



commit c65abe62b4fad9f9eddf2b606eb62a7819c6e091
Author: Philip Withnall <philip tecnocode co uk>
Date:   Mon Sep 30 13:13:33 2013 +0100

    screenshot: Attempt to silence warnings about printf() formatting
    
    A format string is passed through a couple of functions in the
    screenshot plugin, hence gcc warns about using a variable format
    string in a printf() call. Attempt to silence this by annotating
    the functions with G_GNUC_FORMAT() and also disabling that warning
    for the plugin.

 src/plugins/screenshot/Makefile.am               |    3 ++-
 src/plugins/screenshot/totem-screenshot-plugin.c |    2 ++
 src/plugins/screenshot/totem-screenshot-plugin.h |    2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/screenshot/Makefile.am b/src/plugins/screenshot/Makefile.am
index 87e8268..ae4dbf2 100644
--- a/src/plugins/screenshot/Makefile.am
+++ b/src/plugins/screenshot/Makefile.am
@@ -19,7 +19,8 @@ libscreenshot_la_SOURCES = \
        totem-gallery-progress.c        \
        totem-gallery-progress.h
 libscreenshot_la_LDFLAGS = $(plugin_ldflags)
-libscreenshot_la_CFLAGS = $(plugin_cflags)
+# format-nonliteral causes failures for the totem_screenshot_plugin_setup_file_chooser() function
+libscreenshot_la_CFLAGS = $(plugin_cflags) -Wno-error=format-nonliteral -Wno-format-nonliteral
 libscreenshot_la_LIBADD = $(plugin_libadd)
 
 -include $(top_srcdir)/git.mk
diff --git a/src/plugins/screenshot/totem-screenshot-plugin.c 
b/src/plugins/screenshot/totem-screenshot-plugin.c
index 4eacedf..657e0b7 100644
--- a/src/plugins/screenshot/totem-screenshot-plugin.c
+++ b/src/plugins/screenshot/totem-screenshot-plugin.c
@@ -372,6 +372,8 @@ impl_deactivate (PeasActivatable *plugin)
        g_object_unref (priv->bvw);
 }
 
+static char *make_filename_for_dir (const char *directory, const char *format, const char *movie_title) 
G_GNUC_FORMAT (2);
+
 static char *
 make_filename_for_dir (const char *directory, const char *format, const char *movie_title)
 {
diff --git a/src/plugins/screenshot/totem-screenshot-plugin.h 
b/src/plugins/screenshot/totem-screenshot-plugin.h
index 20d7048..a59ce66 100644
--- a/src/plugins/screenshot/totem-screenshot-plugin.h
+++ b/src/plugins/screenshot/totem-screenshot-plugin.h
@@ -36,7 +36,7 @@
 
 G_BEGIN_DECLS
 
-gchar *totem_screenshot_plugin_setup_file_chooser (const char *filename_format, const char *movie_name) 
G_GNUC_WARN_UNUSED_RESULT;
+gchar *totem_screenshot_plugin_setup_file_chooser (const char *filename_format, const char *movie_name) 
G_GNUC_WARN_UNUSED_RESULT G_GNUC_FORMAT (1);
 void totem_screenshot_plugin_update_file_chooser (const char *filename);
 
 G_END_DECLS


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