mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-12 16:06:42 +02:00
23 lines
975 B
Diff
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
|