diff options
author | Robert Marko <robimarko@gmail.com> | 2024-04-27 13:41:11 +0200 |
---|---|---|
committer | Robert Marko <robimarko@gmail.com> | 2024-04-27 15:14:06 +0200 |
commit | 8d65f0208798625c68b019d417f964b4e609cda1 (patch) | |
tree | 4ea19dd717eb8b0d76c84cbdc1cc84d03b330154 | |
parent | 4a6911fe7911914eb1319d55dd0de02542a16247 (diff) | |
download | openwrt-8d65f0208798625c68b019d417f964b4e609cda1.tar.gz openwrt-8d65f0208798625c68b019d417f964b4e609cda1.tar.bz2 openwrt-8d65f0208798625c68b019d417f964b4e609cda1.zip |
tools/cpio: fix compilation on macOS 14
Current cpio 2.13 in 22.03 will fail to compile when using macOS 14 with:
gcc -DHAVE_CONFIG_H -I. -I.. -I/Volumes/OpenWrt/openwrt/staging_dir/host/include -O2 -I/Volumes/OpenWrt/openwrt/staging_dir/host/include -MT obstack.o -MD -MP -MF .deps/obstack.Tpo -c -o obstack.o obstack.c
obstack.c:351:31: error: incompatible function pointer types initializing 'void (*)(void) __attribute__((noreturn))' with an expression of type 'void (void)' [-Wincompatible-function-pointer-types]
__attribute_noreturn__ void (*obstack_alloc_failed_handler) (void)
^
1 error generated.
make[7]: *** [Makefile:1586: obstack.o] Error 1
Backporting gnulib commit ("obstack: Fix a clang warning") fixes this.
Fixes: #15270
Signed-off-by: Robert Marko <robimarko@gmail.com>
-rw-r--r-- | tools/cpio/patches/002-obstack-Fix-a-clang-warning.patch | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/cpio/patches/002-obstack-Fix-a-clang-warning.patch b/tools/cpio/patches/002-obstack-Fix-a-clang-warning.patch new file mode 100644 index 0000000000..b79124469d --- /dev/null +++ b/tools/cpio/patches/002-obstack-Fix-a-clang-warning.patch @@ -0,0 +1,21 @@ +From 0cc39712803ade7b2d4b89c36b143dad72404063 Mon Sep 17 00:00:00 2001 +From: Bruno Haible <bruno@clisp.org> +Date: Sun, 18 Oct 2020 14:37:13 +0200 +Subject: [PATCH] obstack: Fix a clang warning. + +* gnu/obstack.c (print_and_abort): Mark as __attribute_noreturn__. +--- + gnu/obstack.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/gnu/obstack.c ++++ b/gnu/obstack.c +@@ -326,7 +326,7 @@ int obstack_exit_failure = EXIT_FAILURE; + # include <libio/iolibio.h> + # endif + +-static _Noreturn void ++static __attribute_noreturn__ void + print_and_abort (void) + { + /* Don't change any of these strings. Yes, it would be possible to add |