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 780444 - nm-manager: Use g_dbus_message_new_method_error_literal() to avoid -Werror=format-security build failure
nm-manager: Use g_dbus_message_new_method_error_literal() to avoid -Werror=fo...
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2017-03-23 12:03 UTC by Iain Lane
Modified: 2017-03-23 12:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
nm-manager: Use g_dbus_message_new_method_error_literal() (5.40 KB, patch)
2017-03-23 12:03 UTC, Iain Lane
none Details | Review

Description Iain Lane 2017-03-23 12:03:18 UTC
GLib 2.52 added a G_GNUC_PRINTF attribute to
g_dbus_message_new_method_error(). This triggered warning in
NetworkManager when built with -Wformat, which is an error when built
with -Werror=format-security. It seems that gcc isn't smart enough to
see that (foo = "bar") should be treated as a literal.

Fortunately there is a g_dbus_message_new_method_error_literal()
function which does not take printf-style arguments, and we don't need
them, so we can use that.

This patch was originally by Rico Tzschichholz <ricotz@ubuntu.com>, and
was submitted to Launchpad at

https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1650972
Comment 1 Iain Lane 2017-03-23 12:03:22 UTC
Created attachment 348567 [details] [review]
nm-manager: Use g_dbus_message_new_method_error_literal()