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 640537 - Last commit change to src/core/main.c makes mutter unbuildable
Last commit change to src/core/main.c makes mutter unbuildable
Status: RESOLVED DUPLICATE of bug 640508
Product: mutter
Classification: Core
Component: general
git master
Other Linux
: Normal major
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2011-01-25 12:41 UTC by Ivaylo Valkov
Modified: 2011-01-25 13:10 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ivaylo Valkov 2011-01-25 12:41:08 UTC
The last change to src/core/main.c from 24th January  makes mutter unbuildable in jhbuild
The error is:
  CC     main.o
cc1: warnings being treated as errors
core/main.c: In function ‘sigterm_handler’:
core/main.c:445: error: ignoring return value of ‘write’, declared with attribute warn_unused_result
make[4]: *** [main.o] Error 1

With the old code I am able to build.

The changes are:
git diff 48b9807c86d520b4b007dd0a438f3c5d72a9a477..4f079affea4a9d55a97c7150c2973c69166bc64e src/core/main.c
diff --git a/src/core/main.c b/src/core/main.c
index 9efb549..1ea6f5d 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -442,9 +442,7 @@ sigterm_handler (int signum)
 {
   if (sigterm_pipe_fds[1] >= 0)
     {
-      int dummy;
-
-      dummy = write (sigterm_pipe_fds[1], "", 1);
+      (void) write (sigterm_pipe_fds[1], "", 1);
       close (sigterm_pipe_fds[1]);
       sigterm_pipe_fds[1] = -1;
     }
Comment 1 Ivaylo Valkov 2011-01-25 13:08:32 UTC
Just read carefully the commit log and bug #640469. It was meant to fix GCC 4.6 warnings for unused variables.
The new code breaks in gcc 4.4.3 under Trisquel:

gcc --version
gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Comment 2 Owen Taylor 2011-01-25 13:10:33 UTC

*** This bug has been marked as a duplicate of bug 640508 ***