aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2017-01-30 09:43:25 -0800
committerIan Lance Taylor <iant@golang.org>2017-01-30 19:27:49 +0000
commit09496599520d73171550987b138d85ae1fb13b76 (patch)
tree9a697e73d5ecd39a9ec18dd530fb897be1afbebc
parent4cffe2b604d0980e6fb9b994b31f69c53045a460 (diff)
downloadgo-09496599520d73171550987b138d85ae1fb13b76.tar.gz
go-09496599520d73171550987b138d85ae1fb13b76.zip
runtime: add explicit (void) in C to avoid GCC 7 problem
This avoids errors like ./traceback.go:80:2: call of non-function C.f1 I filed https://gcc.gnu.org/PR79289 for the GCC problem. I think this is a bug in GCC, and it may be fixed before the final GCC 7 release. This CL is correct either way. Fixes #18855. Change-Id: I0785a7b7c5b1d0ca87b454b5eca9079f390fcbd4 Reviewed-on: https://go-review.googlesource.com/35919 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
-rw-r--r--src/runtime/testdata/testprogcgo/threadpprof.go2
-rw-r--r--src/runtime/testdata/testprogcgo/traceback.go6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/runtime/testdata/testprogcgo/threadpprof.go b/src/runtime/testdata/testprogcgo/threadpprof.go
index 44afb91d96..3da82961b9 100644
--- a/src/runtime/testdata/testprogcgo/threadpprof.go
+++ b/src/runtime/testdata/testprogcgo/threadpprof.go
@@ -61,7 +61,7 @@ static void* cpuHogDriver(void* arg __attribute__ ((unused))) {
return 0;
}
-void runCPUHogThread() {
+void runCPUHogThread(void) {
pthread_t tid;
pthread_create(&tid, 0, cpuHogDriver, 0);
}
diff --git a/src/runtime/testdata/testprogcgo/traceback.go b/src/runtime/testdata/testprogcgo/traceback.go
index e8b0a04556..2a023f66ca 100644
--- a/src/runtime/testdata/testprogcgo/traceback.go
+++ b/src/runtime/testdata/testprogcgo/traceback.go
@@ -15,16 +15,16 @@ package main
char *p;
-static int f3() {
+static int f3(void) {
*p = 0;
return 0;
}
-static int f2() {
+static int f2(void) {
return f3();
}
-static int f1() {
+static int f1(void) {
return f2();
}