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 640508 - Build mutter failed in core/main.c:445
Build mutter failed in core/main.c:445
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: building
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 640537 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-01-25 03:25 UTC by huacnlee
Modified: 2011-01-25 13:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use G_GNUC_UNUSED to suppress warning (988 bytes, patch)
2011-01-25 04:00 UTC, Owen Taylor
committed Details | Review

Description huacnlee 2011-01-25 03:25:56 UTC
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] 错误 1
make[4]:正在离开目录 `/home/jason/gnome-shell/source/mutter/src'
make[3]: *** [all-recursive] 错误 1
make[3]:正在离开目录 `/home/jason/gnome-shell/source/mutter/src'
make[2]: *** [all] 错误 2
make[2]:正在离开目录 `/home/jason/gnome-shell/source/mutter/src'
make[1]: *** [all-recursive] 错误 1
make[1]:正在离开目录 `/home/jason/gnome-shell/source/mutter'
make: *** [all] 错误 2
*** Error during phase build of mutter: ########## Error running make   *** [16/33]


  [1] Rerun phase build
  [2] Ignore error and continue to install
  [3] Give up on module
  [4] Start shell
  [5] Reload configuration
  [6] Go to phase "wipe directory and start over"
  [7] Go to phase "configure"
  [8] Go to phase "clean"
  [9] Go to phase "distclean"
choice:
Comment 1 Owen Taylor 2011-01-25 04:00:49 UTC
Created attachment 179266 [details] [review]
Use G_GNUC_UNUSED to suppress warning

Contrary to expectations, (void)<expr> doesn't suppress
warnings from __attribute__((warn_unused_result)), so use
G_GNUC_UNUSED (which expands to __attribute__((unused))) instead
of removing a dummy variable.

===

Testing appreciated; seems to work OK with GCC 4.6, but I'm not 100%
positive if it will work on the libc's with the excessive warn_unused_result
annotations.
Comment 2 huacnlee 2011-01-25 05:24:51 UTC
I am build in GCC 4.4.3, Ubuntu 10.04
Can I build it in this gcc version?
How can I do?

(In reply to comment #1)
> Created an attachment (id=179266) [details] [review]
> Use G_GNUC_UNUSED to suppress warning
> 
> Contrary to expectations, (void)<expr> doesn't suppress
> warnings from __attribute__((warn_unused_result)), so use
> G_GNUC_UNUSED (which expands to __attribute__((unused))) instead
> of removing a dummy variable.
> 
> ===
> 
> Testing appreciated; seems to work OK with GCC 4.6, but I'm not 100%
> positive if it will work on the libc's with the excessive warn_unused_result
> annotations.
Comment 3 Owen Taylor 2011-01-25 13:10:33 UTC
*** Bug 640537 has been marked as a duplicate of this bug. ***
Comment 4 huacnlee 2011-01-25 13:19:27 UTC
Thanks. This issue I was resolved, when I install gcc 4.5.2
Comment 5 huacnlee 2011-01-25 13:20:08 UTC
Install gcc 4.5.2 to resolved this issue.
Comment 6 Milan Bouchet-Valat 2011-01-25 13:26:53 UTC
Please don't close a bug because you have found a workaround to it. Some people will experience it with other versions of GCC (I do).

Owen: your patch works here with gcc 4.4.4, if that's the answer you're looking for.

(As a simple temporary solution for people that need to build Mutter, just choose the option to start a shell when the build fails, and run:
make CFLAGS+="-Wno-error")
Comment 7 Ivaylo Valkov 2011-01-25 13:33:45 UTC
(In reply to comment #1)
> Created an attachment (id=179266) [details] [review]
> Use G_GNUC_UNUSED to suppress warning
[...]
> Testing appreciated; seems to work OK with GCC 4.6 [...]

Builds with GCC 4.4.3 under Trisquel.
Comment 8 Owen Taylor 2011-01-25 13:40:25 UTC
Interesting that upgrading to GCC 4.5 fixed. I guess support for the (void) idiom was added there.

Attachment 179266 [details] pushed as 19d1f97 - Use G_GNUC_UNUSED to suppress warning