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 743439 - Fails to build with -Werror=unused-result
Fails to build with -Werror=unused-result
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: VPN: vpnc
1.0.x
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-01-24 13:14 UTC by Michael Biebl
Modified: 2015-06-11 09:18 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michael Biebl 2015-01-24 13:14:34 UTC
Version: 1.0.0


Latest version of network-manager-vpnc fails to build here under Debian (since the default is Werror):



make[2]: Entering directory '/home/michael/debian/build-area/network-manager-vpnc-1.0.0/src'
gcc -DHAVE_CONFIG_H -I. -I.. -I..  -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32 -I/usr/include/libnm-glib -I/usr/include/NetworkManager -I/usr/include/libnm-glib -I/usr/include/NetworkManager -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -DG_DISABLE_DEPRECATED -DBINDIR=\"/usr/bin\" -DPREFIX=\""/usr"\" -DSYSCONFDIR=\""/etc"\" -DVERSION="\"1.0.0\"" -DLIBDIR=\""/usr/lib/x86_64-linux-gnu"\" -DLIBEXECDIR=\""/usr/lib/NetworkManager"\" -DLOCALSTATEDIR=\""/var"\" -DDATADIR=\"/usr/share\" -DNM_VPNC_LOCALEDIR=\"/usr/share/locale\" -D_FORTIFY_SOURCE=2  -Wall -std=gnu89 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wshadow -Wmissing-declarations -Wmissing-prototypes -Wdeclaration-after-statement -Wstrict-prototypes -Wfloat-equal -Wno-unused-parameter -Wno-sign-compare -fno-strict-aliasing -Wno-unused-but-set-variable -Werror -c -o nm-vpnc-service.o nm-vpnc-service.c
nm-vpnc-service.c: In function '_connect_common':
nm-vpnc-service.c:887:3: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result]
   write (priv->infd, &end, sizeof (end));
   ^
cc1: all warnings being treated as errors
Makefile:510: recipe for target 'nm-vpnc-service.o' failed
Comment 1 Michael Biebl 2015-01-24 13:21:22 UTC
Looking at the code a bit, we have another write() call in write_config_option() [1].

While the return value of write() is stored, there is no proper error handling.
Shouldn't this at least log an error if x != strlen (string)?



[1] https://git.gnome.org/browse/network-manager-vpnc/tree/src/nm-vpnc-service.c#n660
Comment 2 Jiri Klimes 2015-06-11 09:18:31 UTC
A fix pushed to master and nm-1-0:
6013122 service: check write() return value to please compilers (bgo #743439)