GNOME Bugzilla – Bug 756706
[PATCH] gio/gtestdbus.c: don't use non-standard %m printf modifier
Last modified: 2016-02-20 16:14:15 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");
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
Created attachment 313541 [details] [review] [PATCH] gio/gtestdbus.c: don't use non-standard %m printf modifier adjusted whitespace as suggested
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");
Review of attachment 313541 [details] [review]: looks good
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.
Thanks for the review! Committed as https://git.gnome.org/browse/glib/commit/?id=0d0db609590307ecae03627ac55265597d4a0ca0
Why is this using strerror instead of g_strerror ?