build: add -std=gnu17 for the GCC 16 / C23 build
GCC 16 defaults to C23, where "()" in a function declaration means "(void)" rather than "unspecified arguments". That breaks the many legacy K&R-style "()" declarations still present throughout the tree, independently of the K&R-to-ANSI conversion that follows in subsequent per-directory commits. Add -std=gnu17 (single dash; clang silently ignores the "--std=" long form some CI scripts pass) in the gcc SHLIB_CFLAGS block and the emscripten target to restore C17 semantics, and drop the now-unnecessary -Wno-implicit-int suppression from the emscripten target. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
8d61bae1f1
commit
ddcb6e96f2
|
|
@ -8747,7 +8747,11 @@ case $target in
|
|||
*-emscripten*)
|
||||
$as_echo "#define linux 1" >>confdefs.h
|
||||
|
||||
CFLAGS="${CFLAGS} -fPIC -Werror=implicit-function-declaration -Wno-int-conversion -Wno-implicit-int"
|
||||
# emcc (clang) defaults to C23, where "()" means "(void)". Force
|
||||
# -std=gnu17 to keep the legacy "()" declarations compiling, matching
|
||||
# the native gcc build. (-std=gnu17 must be a single dash; clang
|
||||
# silently ignores the "--std=" long form used in some CI scripts.)
|
||||
CFLAGS="${CFLAGS} -std=gnu17 -fPIC -Werror=implicit-function-declaration -Wno-int-conversion"
|
||||
;;
|
||||
*solaris*)
|
||||
$as_echo "#define SYSV 1" >>confdefs.h
|
||||
|
|
@ -9189,7 +9193,10 @@ fi
|
|||
*cygwin*)
|
||||
;;
|
||||
*)
|
||||
SHLIB_CFLAGS="-Wimplicit-int -fPIC"
|
||||
# GCC 16 defaults to C23, where "()" means "(void)". Magic relies on
|
||||
# the older C17 semantics where "()" means "unspecified arguments".
|
||||
# Force -std=gnu17 to keep the legacy declarations compiling.
|
||||
SHLIB_CFLAGS="-std=gnu17 -Wimplicit-int -fPIC"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -1471,7 +1471,11 @@ case $target in
|
|||
;;
|
||||
*-emscripten*)
|
||||
AC_DEFINE(linux)
|
||||
CFLAGS="${CFLAGS} -fPIC -Werror=implicit-function-declaration -Wno-int-conversion -Wno-implicit-int"
|
||||
dnl emcc (clang) defaults to C23, where "()" means "(void)". Force
|
||||
dnl -std=gnu17 to keep the legacy "()" declarations compiling, matching
|
||||
dnl the native gcc build. (-std=gnu17 must be a single dash; clang
|
||||
dnl silently ignores the "--std=" long form used in some CI scripts.)
|
||||
CFLAGS="${CFLAGS} -std=gnu17 -fPIC -Werror=implicit-function-declaration -Wno-int-conversion"
|
||||
;;
|
||||
*solaris*)
|
||||
AC_DEFINE(SYSV)
|
||||
|
|
@ -1854,7 +1858,10 @@ if test $usingTcl ; then
|
|||
*cygwin*)
|
||||
;;
|
||||
*)
|
||||
SHLIB_CFLAGS="-Wimplicit-int -fPIC"
|
||||
dnl GCC 16 defaults to C23, where "()" means "(void)". Magic relies on
|
||||
dnl the older C17 semantics where "()" means "unspecified arguments".
|
||||
dnl Force -std=gnu17 to keep the legacy declarations compiling.
|
||||
SHLIB_CFLAGS="-std=gnu17 -Wimplicit-int -fPIC"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in New Issue