1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
From b8409455daccca3ce34531f063bfd97057f195c9 Mon Sep 17 00:00:00 2001
From: Colin Watson <cjwatson@debian.org>
Date: Fri, 9 Aug 2024 08:03:55 +0100
Subject: Don't rely on implicit int types
These are errors in GCC 14.
Bug-Debian: https://bugs.debian.org/1078145
Last-Update: 2024-08-09
Patch-Name: implicit-int.patch
---
Configure | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/Configure b/Configure
index 38d70ad..92a01f8 100755
--- a/Configure
+++ b/Configure
@@ -4098,7 +4098,7 @@ echo "Checking your choice of C compiler and flags for coherency..." >&4
$cat > try.c <<'EOF'
#include <stdio.h>
#include <stdlib.h>
-main() { printf("Ok\n"); exit(0); }
+int main() { printf("Ok\n"); exit(0); }
EOF
set X $cc $optimize $ccflags -o try $ldflags try.c $libs
shift
@@ -4720,7 +4720,8 @@ yes)
else tval=false;
fi;;
*)
- echo "main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
+ echo "#include <stdio.h>" > t.c;
+ echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" >> t.c;
if $cc $optimize $ccflags -Wno-error=implicit-function-declaration $ldflags -o t t.c $libs >/dev/null 2>&1;
then tval=true;
else tval=false;
@@ -5230,7 +5231,8 @@ case "$d_nolnbuf" in
'')
$cat <<'EOT' >blurfl.c
#include <stdio.h>
-main()
+#include <unistd.h>
+int main()
{
int i;
@@ -5239,6 +5241,7 @@ main()
sleep(1);
}
putchar('\n');
+ return 0;
}
EOT
$cc -o blurfl blurfl.c >/dev/null 2>&1;
@@ -5533,7 +5536,7 @@ case "$d_wifstat" in
#include <sys/types.h>
#include <sys/wait.h>
-main()
+int main()
{
$type status;
int e = 0;
@@ -6123,7 +6126,7 @@ $cat >try.c <<'EOCP'
#ifdef I_SYSSELECT
#include <sys/select.h>
#endif
-main()
+int main()
{
struct tm foo;
#ifdef S_TIMEVAL
|