[genius] Wed Sep 07 14:45:53 2016 Jiri (George) Lebl <jirka 5z com>



commit e81d2c90979c05c441f7acf8efe94e5ecca1b609
Author: Jiri (George) Lebl <jiri lebl gmail com>
Date:   Wed Sep 7 14:45:58 2016 -0500

    Wed Sep 07 14:45:53 2016  Jiri (George) Lebl <jirka 5z com>
    
        * ve/ve-misc.c: ignore a warning in ve_strftime

 ChangeLog    |    4 ++++
 ve/ve-misc.c |   14 ++++++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index efb8843..a938751 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Wed Sep 07 14:45:53 2016  Jiri (George) Lebl <jirka 5z com>
+
+       * ve/ve-misc.c: ignore a warning in ve_strftime
+
 Wed Aug 24 17:58:18 2016  Jiri (George) Lebl <jirka 5z com>
 
        * examples/complex-analysis-mesh.gel,
diff --git a/ve/ve-misc.c b/ve/ve-misc.c
index 9f2e361..e454aec 100644
--- a/ve/ve-misc.c
+++ b/ve/ve-misc.c
@@ -302,12 +302,26 @@ ve_strftime (struct tm *the_tm, const char *format)
        char str[1024];
        char *loc_format = ve_locale_from_utf8 (format);
 
+       /* ignore the format-nonliteral warning here to allow compilation
+        * with warnings as errors */
+#ifdef __GNUC__
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+#endif
+#endif
        if (strftime (str, sizeof (str)-1, loc_format, the_tm) == 0) {
                /* according to docs, if the string does not fit, the
                 * contents of str are undefined, thus just use
                 * ??? */
                strcpy (str, "???");
        }
+#ifdef __GNUC__
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5)
+#pragma GCC diagnostic pop
+#endif
+#endif
+
        str [sizeof (str)-1] = '\0'; /* just for sanity */
        g_free (loc_format);
 


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