From: Hauke Mehrtens Date: Sat, 20 Jun 2026 18:47:14 +0000 (+0200) Subject: ead: fix compilation with GCC 15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F23955%2Fhead;p=thirdparty%2Fopenwrt.git ead: fix compilation with GCC 15 GCC 15 defaults to C23, where an empty parameter list "()" means "(void)" instead of an unspecified argument list. This broke two spots in the bundled tinysrp sources: - The interrupt() signal handler in t_truerand.c was declared with "()", so its type became "void (*)(void)" and no longer matched the "void (*)(int)" expected by signal(): t_truerand.c:100:32: error: passing argument 2 of 'signal' from incompatible pointer type [-Wincompatible-pointer-types] Give it the proper signal handler signature instead. - The pre-ANSI fallback in t_defines.h declared strchr(), strrchr() and strtok() with "()". ead.c is compiled without -DHAVE_CONFIG_H, so STDC_HEADERS is undefined and that legacy branch is taken, where the zero-argument prototypes now conflict with the declarations in the standard headers: tinysrp/t_defines.h:90:30: error: conflicting types for 'strtok'; have 'char *(void)' Drop the dead K&R branch and include and unconditionally; the library's own objects already take this path via config.h. Assisted-by: Claude:claude-opus-4-8 Link: https://github.com/openwrt/openwrt/pull/23955 Signed-off-by: Hauke Mehrtens --- diff --git a/package/network/services/ead/src/tinysrp/t_defines.h b/package/network/services/ead/src/tinysrp/t_defines.h index 4128093f606..1a8e4034d12 100644 --- a/package/network/services/ead/src/tinysrp/t_defines.h +++ b/package/network/services/ead/src/tinysrp/t_defines.h @@ -79,19 +79,8 @@ #endif #endif -#if STDC_HEADERS #include #include -#else /* not STDC_HEADERS */ -#ifndef HAVE_STRCHR -#define strchr index -#define strrchr rindex -#endif -char *strchr(), *strrchr(), *strtok(); -#ifndef HAVE_MEMCPY -#define memcpy(d, s, n) bcopy((s), (d), (n)) -#endif -#endif /* not STDC_HEADERS */ #include diff --git a/package/network/services/ead/src/tinysrp/t_truerand.c b/package/network/services/ead/src/tinysrp/t_truerand.c index fa0d6ce6038..f46a1e18575 100644 --- a/package/network/services/ead/src/tinysrp/t_truerand.c +++ b/package/network/services/ead/src/tinysrp/t_truerand.c @@ -86,7 +86,7 @@ tick() } static void -interrupt() +interrupt(int sig) { if (count) { #ifdef OLD_TRUERAND