After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 768453 - Gdbus test: compilation fails due to -Werror=format-y2k errors
Gdbus test: compilation fails due to -Werror=format-y2k errors
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
2.49.x
Other Linux
: Normal normal
: ---
Assigned To: Simon McVittie
gtkdev
Depends on:
Blocks:
 
 
Reported: 2016-07-05 16:32 UTC by Roman Lebedev
Modified: 2016-08-15 13:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gdbus-example-unix-fd-client: avoid strftime %c specifier (1.14 KB, patch)
2016-08-14 14:37 UTC, Simon McVittie
committed Details | Review

Description Roman Lebedev 2016-07-05 16:32:10 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?
Comment 1 Simon McVittie 2016-08-14 14:37:11 UTC
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.
Comment 2 Colin Walters 2016-08-15 00:30:48 UTC
Review of attachment 333285 [details] [review]:

OK, though hopefully someday someone will replace this with something GDateTime that's sane.
Comment 3 Simon McVittie 2016-08-15 13:06:52 UTC
Fixed in git for 2.49.5 (037719c), 2.48.2 (cd7562b)