]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: add explicit (void) in C to avoid GCC 7 problem
authorIan Lance Taylor <iant@golang.org>
Mon, 30 Jan 2017 17:43:25 +0000 (09:43 -0800)
committerIan Lance Taylor <iant@golang.org>
Mon, 30 Jan 2017 19:27:49 +0000 (19:27 +0000)
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>
src/runtime/testdata/testprogcgo/threadpprof.go
src/runtime/testdata/testprogcgo/traceback.go

index 44afb91d96f1a252f3f87f1771200697c008f110..3da82961b9b74a21d5fe6da480e55d38a91180bf 100644 (file)
@@ -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);
 }
index e8b0a04556a0f135f22e8ac9597d2fb96930101f..2a023f66caeb74f49933e2f9111b20beac3faa69 100644 (file)
@@ -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();
 }