aports/testing/p0f/gcc14.patch
2024-09-23 01:41:08 +00:00

23 lines
975 B
Diff

Fix -Wimplicit-function-declaration error with gcc 14.
```
.build-14155.c: In function 'main':
.build-14155.c:2:34: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
2 | volatile u8 tmp[6]; int main() { printf("%d\n", *(u32*)(tmp+1)); return 0; }
| ^~~~~~
.build-14155.c:2:1: note: include '<stdio.h>' or provide a declaration of 'printf'
1 | #include "types.h"
+++ |+#include <stdio.h>
```
--- p0f-3.09b-r2/build.sh
+++ p0f-3.09b-r3/build.sh
@@ -197,7 +197,7 @@
rm -f "$TMP" "$TMP.c" "$TMP.log" || exit 1
-echo -e "#include \"types.h\"\nvolatile u8 tmp[6]; int main() { printf(\"%d\x5cn\", *(u32*)(tmp+1)); return 0; }" >"$TMP.c" || exit 1
+echo -e "#include <stdio.h>\n#include \"types.h\"\nvolatile u8 tmp[6]; int main() { printf(\"%d\x5cn\", *(u32*)(tmp+1)); return 0; }" >"$TMP.c" || exit 1
$CC $USE_CFLAGS $USE_LDFLAGS "$TMP.c" -o "$TMP" &>"$TMP.log"
if [ ! -x "$TMP" ]; then