]> git.ipfire.org Git - thirdparty/openwrt.git/commit
ead: fix compilation with GCC 15 23955/head
authorHauke Mehrtens <hauke@hauke-m.de>
Sat, 20 Jun 2026 18:47:14 +0000 (20:47 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 27 Jun 2026 09:50:10 +0000 (11:50 +0200)
commit0161349c1b48ac060c4a1beab00501ee59627dd5
treeec5c214bcb23b40dff8822e7ed9c775a9dfb87a0
parent4a5642413be47e5f43d161a2a087ca6f45c9706b
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 <stdlib.h> and <string.h>
    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 <hauke@hauke-m.de>
package/network/services/ead/src/tinysrp/t_defines.h
package/network/services/ead/src/tinysrp/t_truerand.c