+2023-04-23 Paul Eggert <eggert@cs.ucla.edu>
+
+ manywarnings: omit -fno-common in GCC 10+
+ * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Omit -fno-common
+ in GCC 10 and later, as it is the default there.
+ Check exit status of ‘gcc --version’.
+
2023-04-23 Bruno Haible <bruno@clisp.org>
libunistring: Fix build on Windows, when a libunistring is installed.
# <(LC_ALL=C gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort)
$1=
- for gl_manywarn_item in -fanalyzer -fno-common \
+ for gl_manywarn_item in -fanalyzer \
-Wall \
-Warith-conversion \
-Wbad-function-cast \
gl_AS_VAR_APPEND([$1], [' -Wvla-larger-than=4031'])
# These are needed for older GCC versions.
- if test -n "$GCC"; then
- case `($CC --version) 2>/dev/null` in
+ if test -n "$GCC" && gl_gcc_version=`($CC --version) 2>/dev/null`; then
+ case $gl_gcc_version in
'gcc (GCC) '[[0-3]].* | \
'gcc (GCC) '4.[[0-7]].*)
gl_AS_VAR_APPEND([$1], [' -fdiagnostics-show-option'])
gl_AS_VAR_APPEND([$1], [' -funit-at-a-time'])
;;
esac
+ case $gl_gcc_version in
+ 'gcc (GCC) '[[0-9]].*)
+ gl_AS_VAR_APPEND([$1], [' -fno-common'])
+ ;;
+ esac
fi
# Disable specific options as needed.