This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
libgo patch committed: Avoid unused result warning
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org, gofrontend-dev at googlegroups dot com
- Date: Tue, 27 May 2014 15:01:27 -0700
- Subject: libgo patch committed: Avoid unused result warning
- Authentication-results: sourceware.org; auth=none
On crazy systems that mark the write system call as __attribute__
((warn_unused_result)), libgo gets a build failure. This patch from
Andrew Wilkins fixes it. Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu. Committed to mainline and 4.9 branch.
Ian
diff -r 0127d52c1d74 libgo/runtime/proc.c
--- a/libgo/runtime/proc.c Tue May 27 14:27:36 2014 -0700
+++ b/libgo/runtime/proc.c Tue May 27 14:29:55 2014 -0700
@@ -1117,7 +1117,8 @@
if(runtime_needextram) {
// Can happen if C/C++ code calls Go from a global ctor.
// Can not throw, because scheduler is not initialized yet.
- runtime_write(2, "fatal error: cgo callback before cgo call\n",
+ int rv __attribute__((unused));
+ rv = runtime_write(2, "fatal error: cgo callback before cgo call\n",
sizeof("fatal error: cgo callback before cgo call\n")-1);
runtime_exit(1);
}