GNOME Bugzilla – Bug 768453
Gdbus test: compilation fails due to -Werror=format-y2k errors
Last modified: 2016-08-15 13:07:07 UTC
Copied from https://bugzilla.gnome.org/show_bug.cgi?id=764575#c5 Current git master of glib fails to compile for me with gcc-6: gdbus-example-unix-fd-client.c: In function ‘on_name_appeared’: gdbus-example-unix-fd-client.c:85:17: error: ‘%c’ yields only last 2 digits of year in some locales [-Werror=format-y2k] "%c", ^~~~ I can supply a patch, but i'm not sure what is the proper fix? A pragma to disable the warning? Etc?
Created attachment 333285 [details] [review] gdbus-example-unix-fd-client: avoid strftime %c specifier gcc 6 warns (fatally, by default) that %c only uses a 2-digit year in some locales. The precise format does not seem to be important for this sample code, so use ISO 8601 instead of suppressing the warning with a pragma.
Review of attachment 333285 [details] [review]: OK, though hopefully someday someone will replace this with something GDateTime that's sane.
Fixed in git for 2.49.5 (037719c), 2.48.2 (cd7562b)