[eog] EogExifUtil: Fix build with newer GCC



commit ca4c09a64b3f33abe67d46b8dbd4e44e1e028af5
Author: Felix Riemann <friemann gnome org>
Date:   Mon Jun 13 20:35:52 2016 +0200

    EogExifUtil: Fix build with newer GCC
    
    Newer gcc may produce an error if they cannot
    check the format arguments.

 src/eog-exif-util.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/eog-exif-util.c b/src/eog-exif-util.c
index 1695872..d75087f 100644
--- a/src/eog-exif-util.c
+++ b/src/eog-exif-util.c
@@ -118,8 +118,11 @@ eog_exif_util_format_date_with_strptime (const gchar *date, const gchar* format)
                if (!GPOINTER_TO_BOOLEAN (strptime_updates_wday.retval))
                        _calculate_wday_yday (&tm);
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
                /* A strftime-formatted string, to display the date the image was taken.  */
                dlen = strftime (tmp_date, DATE_BUF_SIZE * sizeof(gchar), format, &tm);
+#pragma GCC diagnostic pop
                new_date = g_strndup (tmp_date, dlen);
        }
 
@@ -153,7 +156,10 @@ eog_exif_util_format_date_by_hand (const gchar *date, const gchar* format)
                tm.tm_sec = result < 6 ? 0 : seconds;
                tm.tm_min = result < 5 ? 0 : minutes;
                tm.tm_hour = result < 4 ? 0 : hour;
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
                dlen = strftime (tmp_date, DATE_BUF_SIZE * sizeof(gchar), format, &tm);
+#pragma GCC diagnostic pop
 
                if (dlen == 0)
                        return NULL;


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