Skip to content

Commit

Permalink
EomExifUtil: Fix build with newer GCC
Browse files Browse the repository at this point in the history
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
  • Loading branch information
fxri authored and raveit65 committed Jul 25, 2018
1 parent 1e96c9d commit e12f285
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/eom-exif-util.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ _calculate_wday_yday (struct tm *tm)
tm->tm_yday = tmp_tm.tm_yday; 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 #ifdef HAVE_STRPTIME
static gchar * static gchar *
eom_exif_util_format_date_with_strptime (const gchar *date, const gchar* format) eom_exif_util_format_date_with_strptime (const gchar *date, const gchar* format)
Expand Down Expand Up @@ -164,6 +170,8 @@ eom_exif_util_format_date_by_hand (const gchar *date, const gchar* format)
} }
#endif /* HAVE_STRPTIME */ #endif /* HAVE_STRPTIME */


#pragma GCC diagnostic pop

/** /**
* eom_exif_util_format_date: * eom_exif_util_format_date:
* @date: a date string following Exif specifications * @date: a date string following Exif specifications
Expand Down

0 comments on commit e12f285

Please sign in to comment.