]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
testsuite: Avoid C99 compatibility issues in run-native-test.sh
authorFlorian Weimer <fweimer@redhat.com>
Sat, 22 Apr 2023 19:37:09 +0000 (21:37 +0200)
committerMark Wielaard <mark@klomp.org>
Sat, 22 Apr 2023 19:47:09 +0000 (21:47 +0200)
Include <unistd.h> for the pause function, and add the return type
of main.  Avoids an implicit function declaration and implicit int.

Signed-off-by: Florian Weimer <fweimer@redhat.com>
tests/run-native-test.sh

index d19007f2ff04e173dd7b69db0499874ad59a6307..042a51c6c93aa5fbb6ae2798c7b422cda7d6a63e 100755 (executable)
@@ -27,7 +27,8 @@
 # in all builds.
 
 tempfiles native.c native
-echo 'main () { while (1) pause (); }' > native.c
+printf '#include <unistd.h>\nint main (void) { while (1) pause (); }\n' \
+  > native.c
 
 native=0
 kill_native()