aports/testing/care/20-gcc14.patch
2024-10-15 14:01:26 +00:00

26 lines
1.2 KiB
Diff

Fix -Wimplicit-function-declaration error with gcc 14.
```
./cli/cli.c: In function 'parse_config':
./cli/cli.c:311:33: error: implicit declaration of function 'basename' [-Wimplicit-function-declaration]
311 | if (strncasecmp(basename(argv[0]), "care", strlen("care")) == 0)
| ^~~~~~~~
./cli/cli.c:311:33: error: passing argument 1 of 'strncasecmp' makes pointer from integer without a cast [-Wint-conversion]
311 | if (strncasecmp(basename(argv[0]), "care", strlen("care")) == 0)
| ^~~~~~~~~~~~~~~~~
| |
| int
```
--- proot-5.4.0-origin/src/cli/cli.c
+++ proot-5.4.0/src/cli/cli.c
@@ -23,7 +23,8 @@
#include <stdio.h> /* printf(3), */
#include <stdbool.h> /* bool, true, false, */
#include <linux/limits.h> /* ARG_MAX, PATH_MAX, */
-#include <string.h> /* str*(3), basename(3), */
+#include <libgen.h> /* basename(), */
+#include <string.h> /* str*(3), */
#include <talloc.h> /* talloc*, */
#include <stdlib.h> /* exit(3), EXIT_*, strtol(3), {g,s}etenv(3), */
#include <assert.h> /* assert(3), */