GNOME Bugzilla – Bug 734947
cups backend should define _XOPEN_SOURCE or _GNU_SOURCE on any glibc, not just Linux
Last modified: 2014-08-25 10:47:07 UTC
gtkprintbackendcups.c uses #ifdef __linux__ #define _GNU_SOURCE #endif and then uses strptime(). On systems that use glibc but are not Linux (e.g. Debian GNU/kFreeBSD and GNU/Hurd) this results in: /build/gtk+3.0-KGFa7z/gtk+3.0-3.12.2/./modules/printbackends/cups/gtkprintbackendcups.c: In function 'localtime_to_utctime': /build/gtk+3.0-KGFa7z/gtk+3.0-3.12.2/./modules/printbackends/cups/gtkprintbackendcups.c:5569:9: warning: implicit declaration of function 'strptime' [-Wimplicit-function-declaration] end = strptime (local_time, formats_0[i], &local_print_time); ^ /build/gtk+3.0-KGFa7z/gtk+3.0-3.12.2/./modules/printbackends/cups/gtkprintbackendcups.c:5569:13: warning: assignment makes pointer from integer without a cast end = strptime (local_time, formats_0[i], &local_print_time); ^ /build/gtk+3.0-KGFa7z/gtk+3.0-3.12.2/./modules/printbackends/cups/gtkprintbackendcups.c:5571:13: warning: assignment makes pointer from integer without a cast end = strptime (local_time, formats_1[i], &local_print_time); ^ and possibly truncating pointers to 32 bits, causing runtime failure. I think it would be better to use AC_USE_SYSTEM_EXTENSIONS in configure.ac, like GLib does since Bug #684123 was fixed.
Created attachment 283652 [details] [review] Use AC_USE_SYSTEM_EXTENSIONS to get _GNU_SOURCE, _XOPEN_SOURCE etc. Similar to Bug #684123 in GLib.
Review of attachment 283652 [details] [review]: Ok
Comment on attachment 283652 [details] [review] Use AC_USE_SYSTEM_EXTENSIONS to get _GNU_SOURCE, _XOPEN_SOURCE etc. Commit d329544 for 3.13.8. I merged it but forgot to say so here - thanks for closing the bug, Matthias.