iperf
iperf copied to clipboard
fix: GCC 15 / C23 compatibility — uint, u_char, _DEFAULT_SOURCE
GCC 15 defaults to -std=gnu23 (C23), which removes uint and u_char from <sys/types.h> and no longer implicitly defines _DEFAULT_SOURCE. This hides POSIX functions like daemon(3), gai_strerror(3), fileno(3), getaddrinfo(3), and others behind feature-test macros.
Changes:
src/iperf.h: Addtypedef unsigned int uintcompatibility fallbacksrc/iperf_config.h.in: Define_DEFAULT_SOURCEglobally so all files that include it pick it upsrc/iperf_client_api.c,iperf_server_api.c,iperf_tcp.c: Add_DEFAULT_SOURCEbefore system headers (these files include system headers beforeiperf_config.h)src/units.c: Replaceu_charwithunsigned charin atoupper()cast
Tested:
- ✅
gcc -std=c2x -Werror— clean build (C23 mode) - ✅ Default flags — clean build (no regression)
Fixes #1838.
Thanks for the PR! We'll take a look at this.
👋 Gentle nudge — just following up on this GCC 15 / C23 compatibility PR. Happy to address any feedback or make adjustments. Thanks!