Commit 09496599 authored by Ian Lance Taylor's avatar Ian Lance Taylor

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: default avatarDavid Crawshaw <crawshaw@golang.org>
parent 4cffe2b6
...@@ -61,7 +61,7 @@ static void* cpuHogDriver(void* arg __attribute__ ((unused))) { ...@@ -61,7 +61,7 @@ static void* cpuHogDriver(void* arg __attribute__ ((unused))) {
return 0; return 0;
} }
void runCPUHogThread() { void runCPUHogThread(void) {
pthread_t tid; pthread_t tid;
pthread_create(&tid, 0, cpuHogDriver, 0); pthread_create(&tid, 0, cpuHogDriver, 0);
} }
......
...@@ -15,16 +15,16 @@ package main ...@@ -15,16 +15,16 @@ package main
char *p; char *p;
static int f3() { static int f3(void) {
*p = 0; *p = 0;
return 0; return 0;
} }
static int f2() { static int f2(void) {
return f3(); return f3();
} }
static int f1() { static int f1(void) {
return f2(); return f2();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment