diff options
| author | Robert Marko | 2025-04-16 11:56:22 +0000 |
|---|---|---|
| committer | Robert Marko | 2025-04-25 08:55:03 +0000 |
| commit | 5531dc7109017237d3ac6d9611a9231766c5c8fc (patch) | |
| tree | c9f3d4f046589141dce3aaf8b3fe07fb33809e37 | |
| parent | 9b652e276f9d9bea40902c11cae39ca2c61e3f92 (diff) | |
| download | openwrt-5531dc7109017237d3ac6d9611a9231766c5c8fc.tar.gz | |
tools: cpio: fix compilation with GCC15
Fedora 42 updated to GCC15 which now defaults to GNU23 as the default
instead of GNU17[1], and this breaks cpio compilation.
Its been reported upstream [2], so import the patch attached to the bug
report that fixes compilation with GCC15.
[1] https://gcc.gnu.org/gcc-15/porting_to.html#c23
[2] https://savannah.gnu.org/bugs/?66297
Link: https://github.com/openwrt/openwrt/pull/18506
(cherry picked from commit c5041094ba06b3cdfb9458f1cb5acb00a9cbacd3)
Link: https://github.com/openwrt/openwrt/pull/18581
Signed-off-by: Robert Marko <robimarko@gmail.com>
| -rw-r--r-- | tools/cpio/patches/cpio-c23.patch | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/cpio/patches/cpio-c23.patch b/tools/cpio/patches/cpio-c23.patch new file mode 100644 index 0000000000..825f369d6e --- /dev/null +++ b/tools/cpio/patches/cpio-c23.patch @@ -0,0 +1,23 @@ +--- a/src/extern.h ++++ b/src/extern.h +@@ -97,7 +97,8 @@ extern char input_is_special; + extern char output_is_special; + extern char input_is_seekable; + extern char output_is_seekable; +-extern int (*xstat) (); ++//void not good enough ++extern int (*xstat) (const char * restrict, struct stat * restrict); + extern void (*copy_function) (); + extern char *change_directory_option; + +--- a/src/global.c ++++ b/src/global.c +@@ -185,7 +185,7 @@ bool to_stdout_option = false; + + /* A pointer to either lstat or stat, depending on whether + dereferencing of symlinks is done for input files. */ +-int (*xstat) (); ++int (*xstat) (const char * restrict, struct stat * restrict); + + /* Which copy operation to perform. (-i, -o, -p) */ + void (*copy_function) () = 0; |