This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libgo patch committed: Avoid unused result warning


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]