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 756706 - [PATCH] gio/gtestdbus.c: don't use non-standard %m printf modifier
[PATCH] gio/gtestdbus.c: don't use non-standard %m printf modifier
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gdbus
unspecified
Other NetBSD
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2015-10-16 16:57 UTC by Tobias Nygren
Modified: 2016-02-20 16:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] gio/gtestdbus.c: don't use non-standard %m printf modifier (1.08 KB, patch)
2015-10-16 16:57 UTC, Tobias Nygren
none Details | Review
[PATCH] gio/gtestdbus.c: don't use non-standard %m printf modifier (1.09 KB, patch)
2015-10-17 16:17 UTC, Tobias Nygren
accepted-commit_now Details | Review

Description Tobias Nygren 2015-10-16 16:57:53 UTC
Created attachment 313489 [details] [review]
[PATCH] gio/gtestdbus.c: don't use non-standard %m printf modifier

Usage of %m now triggers a warning on NetBSD. It will not work as intended on non-GNU systems:

testdbus.c:246:11: error: %m is only allowed in syslog(3) like functions [-Werror=format=]
           g_warning ("pipe() failed: %m");
Comment 1 Matthias Clasen 2015-10-17 15:32:18 UTC
Review of attachment 313489 [details] [review]:

looks fine otherrwise

::: gio/gtestdbus.c
@@ +246,3 @@
       if (pipe (pipe_fds) != 0)
         {
+          g_warning ("pipe() failed: %s", strerror(errno));

please put a space before the (

@@ +253,3 @@
         {
         case -1:
+          g_warning ("fork() failed: %s", strerror(errno));

here too
Comment 2 Matthias Clasen 2015-10-17 15:32:28 UTC
Review of attachment 313489 [details] [review]:

looks fine otherrwise

::: gio/gtestdbus.c
@@ +246,3 @@
       if (pipe (pipe_fds) != 0)
         {
+          g_warning ("pipe() failed: %s", strerror(errno));

please put a space before the (

@@ +253,3 @@
         {
         case -1:
+          g_warning ("fork() failed: %s", strerror(errno));

here too
Comment 3 Tobias Nygren 2015-10-17 16:17:03 UTC
Created attachment 313541 [details] [review]
[PATCH] gio/gtestdbus.c: don't use non-standard %m printf modifier

adjusted whitespace as suggested
Comment 4 Patrick Welche 2016-02-12 15:14:03 UTC
Just hit this building git master, OK to commit?

  CC       libgio_2_0_la-ghttpproxy.lo
../../gio/gtestdbus.c: In function 'watcher_init':
../../gio/gtestdbus.c:246:11: error: %m is only allowed in syslog(3) like functions [-Werror=format=]
           g_warning ("pipe() failed: %m");
Comment 5 Matthias Clasen 2016-02-12 15:21:07 UTC
Review of attachment 313541 [details] [review]:

looks good
Comment 6 Colin Walters 2016-02-12 15:22:13 UTC
Review of attachment 313541 [details] [review]:

(In reply to Patrick Welche from comment #4)
> Just hit this building git master, OK to commit?

Ugh, does BSD really not do %m?  It's just a lot easier than doing the int errsv = errno + strerror() dance.  Oh well, yes please commit.
Comment 7 Patrick Welche 2016-02-19 11:35:45 UTC
Thanks for the review! Committed as
https://git.gnome.org/browse/glib/commit/?id=0d0db609590307ecae03627ac55265597d4a0ca0
Comment 8 Christian Persch 2016-02-20 16:14:15 UTC
Why is this using strerror instead of g_strerror ?