Commit 98d13766e5dc4f338ab56faec04e2cfad44afaa3

Florian Weimer 2023-02-07T12:47:13

toke/Makefile: Declare return type of main in GCC flag probe Without it, the probe may incorrectly fail with future compilers which do not support implicit ints.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/toke/Makefile b/toke/Makefile
index 0b9c928..4f56f67 100644
--- a/toke/Makefile
+++ b/toke/Makefile
@@ -41,7 +41,7 @@ LDFLAGS =
 # CFLAGS  := $(CFLAGS) -g
 
 # for gcc 4. remove if you fixed the code.
-_GCC4_CFLAGS=$(shell echo 'main(int argc, char **argv){return 0;}' > .test.c;   \
+_GCC4_CFLAGS=$(shell echo 'int main(int argc, char **argv){return 0;}' > .test.c;   \
 		$(CC) -Wno-pointer-sign -c .test.c -o .test.o > /dev/null 2>&1 \
 		&& echo -Wno-pointer-sign; rm .test.c .test.o )
 CFLAGS  := $(CFLAGS) $(_GCC4_CFLAGS)