Skip to content

Commit e12f285

Browse files
fxriraveit65
authored andcommitted
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
1 parent 1e96c9d commit e12f285

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/eom-exif-util.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ _calculate_wday_yday (struct tm *tm)
9595
tm->tm_yday = tmp_tm.tm_yday;
9696
}
9797

98+
/* Older GCCs don't support pragma diagnostic inside functions.
99+
* Put these here to avoid problems with the strftime format strings
100+
* without breaking the build for these older GCCs */
101+
#pragma GCC diagnostic push
102+
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
103+
98104
#ifdef HAVE_STRPTIME
99105
static gchar *
100106
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)
164170
}
165171
#endif /* HAVE_STRPTIME */
166172

173+
#pragma GCC diagnostic pop
174+
167175
/**
168176
* eom_exif_util_format_date:
169177
* @date: a date string following Exif specifications

0 commit comments

Comments
 (0)