GNOME Bugzilla – Bug 640508
Build mutter failed in core/main.c:445
Last modified: 2011-01-25 13:40:29 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:
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.
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.
*** Bug 640537 has been marked as a duplicate of this bug. ***
Thanks. This issue I was resolved, when I install gcc 4.5.2
Install gcc 4.5.2 to resolved this issue.
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")
(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.
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