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 572373 - guile-gnome-platform-2.16.1 compile fails on gcc 4.3.3 because of warn_unused_result
guile-gnome-platform-2.16.1 compile fails on gcc 4.3.3 because of warn_unused...
Status: RESOLVED FIXED
Product: guile-gnome
Classification: Other
Component: gnome-vfs
bzr trunk
Other All
: Normal critical
: ---
Assigned To: Guile-GNOME maintainer(s)
Guile-GNOME maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2009-02-19 06:33 UTC by Neil Funk
Modified: 2009-02-26 13:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fixes compile on GCC 4.3.3 (613 bytes, patch)
2009-02-21 21:25 UTC, Neil Funk
none Details | Review

Description Neil Funk 2009-02-19 06:33:01 UTC
Steps to reproduce:
gcc (Gentoo 4.3.3 p1.0, pie-10.1.5) 4.3.3
glibc 2.9
binutils 2.19.1
guile-gnome-platform-2.16.1

./configure && make



Stack trace:
[...]
 x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../glib/gnome/gobject -I../../../glib/gnome/gobject -I. -I. -Wall -Werror -g -pthread -DORBIT2=1 -I/usr/include/gnome-vfs-2.0 -I/usr/lib64/gnome-vfs-2.0/include -I/usr/include/gconf/2 -I/usr/include/orbit-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -std=gnu99 -pthread -I/usr/lib64/libffi-3.0.6/include -march=athlon64 -O2 -pipe -MT libgw_guile_gnome_gnome_vfs_la-guile-gnome-gw-gnome-vfs.lo -MD -MP -MF .deps/libgw_guile_gnome_gnome_vfs_la-guile-gnome-gw-gnome-vfs.Tpo -c guile-gnome-gw-gnome-vfs.c  -fPIC -DPIC -o .libs/libgw_guile_gnome_gnome_vfs_la-guile-gnome-gw-gnome-vfs.o
mv -f .deps/libgw_guile_gnome_gnome_vfs_la-gnome-vfs-support.Tpo .deps/libgw_guile_gnome_gnome_vfs_la-gnome-vfs-support.Plo
cc1: warnings being treated as errors
gnome-vfs-port.c: In function 'vport_flush':
gnome-vfs-port.c:397: error: ignoring return value of 'write', declared with attribute warn_unused_result
gnome-vfs-port.c:399: error: ignoring return value of 'write', declared with attribute warn_unused_result
make[5]: *** [libgw_guile_gnome_gnome_vfs_la-gnome-vfs-port.lo] Error 1
make[5]: *** Waiting for unfinished jobs....
mv -f .deps/libgw_guile_gnome_gnome_vfs_la-guile-gnome-gw-gnome-vfs.Tpo .deps/libgw_guile_gnome_gnome_vfs_la-guile-gnome-gw-gnome-vfs.Plo
make[5]: Leaving directory `/var/tmp/portage/dev-scheme/guile-gnome-platform-2.16.1/work/guile-gnome-platform-2.16.1/gnome-vfs/gnome/gw'
make[4]: *** [all] Error 2
make[4]: Leaving directory `/var/tmp/portage/dev-scheme/guile-gnome-platform-2.16.1/work/guile-gnome-platform-2.16.1/gnome-vfs/gnome/gw'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/var/tmp/portage/dev-scheme/guile-gnome-platform-2.16.1/work/guile-gnome-platform-2.16.1/gnome-vfs/gnome'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/dev-scheme/guile-gnome-platform-2.16.1/work/guile-gnome-platform-2.16.1/gnome-vfs'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/dev-scheme/guile-gnome-platform-2.16.1/work/guile-gnome-platform-2.16.1'
make: *** [all] Error 2

Other information:
Suggested patch:

--- gnome-vfs-port.c	2008-04-24 06:41:45.000000000 -0400
+++ /home/neil/guile-gnome-platform-2.16.1/gnome-vfs/gnome/gw/gnome-vfs-port.c	2009-02-19 00:28:18.000000000 -0500
@@ -394,9 +394,11 @@
                 const char *msg = "Error: could not flush gnome-vfs handle ";
                 char buf[11];
 
-                write (2, msg, strlen (msg));
+                if (-1 == write (2, msg, strlen (msg)))
+			exit(-1);
                 sprintf (buf, "%p\n", handle);
-                write (2, buf, strlen (buf));
+                if (-1 == write (2, buf, strlen (buf)))
+			exit(-1);
 
                 count = remaining;
             } else if (scm_gc_running_p) {
Comment 1 Neil Funk 2009-02-21 21:23:10 UTC
This bug doesn't appear on the older 4.1.2 GCC.
Looks like the 4.3 series is a bit more strict.
Can someone please confirm/assign this bug, or comment on the possible patch at the end of my previous post?  Thanks.
Comment 2 Neil Funk 2009-02-21 21:25:54 UTC
Created attachment 129228 [details] [review]
Fixes compile on GCC 4.3.3
Comment 3 Andy Wingo 2009-02-26 13:55:52 UTC
Hi,

Sorry I didn't get around to this. I worked around the issue with a different patch, pushed out to the bzr repo. Thanks for the report!