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);
}