summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Riemann <[email protected]>2017-03-29 20:56:11 +0200
committerraveit65 <[email protected]>2018-07-26 00:45:21 +0200
commite12f28519946136a91ab09e1f5072c6d6e49f00d (patch)
tree94ca53e9349b9f4aec4f055b5d153592006a6304
parent1e96c9da8b3e901a48eaaf87d31c14c581c6b8fb (diff)
downloadeom-e12f28519946136a91ab09e1f5072c6d6e49f00d.tar.bz2
eom-e12f28519946136a91ab09e1f5072c6d6e49f00d.tar.xz
EomExifUtil: Fix build with newer GCC
Newer gcc may produce an error if they cannot check the format arguments. EomExifUtil: Fix build with older GCCs Older GCCs don't support pragma diagnostic in functions. Move the pragmas outside to fix the build with these compilers. https://bugzilla.gnome.org/show_bug.cgi?id=780675 origin commits: https://gitlab.gnome.org/GNOME/eog/commit/ca4c09a https://gitlab.gnome.org/GNOME/eog/commit/d91cf5b
-rw-r--r--src/eom-exif-util.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/eom-exif-util.c b/src/eom-exif-util.c
index a02dea9..3898b75 100644
--- a/src/eom-exif-util.c
+++ b/src/eom-exif-util.c
@@ -95,6 +95,12 @@ _calculate_wday_yday (struct tm *tm)
tm->tm_yday = tmp_tm.tm_yday;
}
+/* Older GCCs don't support pragma diagnostic inside functions.
+ * Put these here to avoid problems with the strftime format strings
+ * without breaking the build for these older GCCs */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+
#ifdef HAVE_STRPTIME
static gchar *
eom_exif_util_format_date_with_strptime (const gchar *date, const gchar* format)
@@ -164,6 +170,8 @@ eom_exif_util_format_date_by_hand (const gchar *date, const gchar* format)
}
#endif /* HAVE_STRPTIME */
+#pragma GCC diagnostic pop
+
/**
* eom_exif_util_format_date:
* @date: a date string following Exif specifications