1
0
Fork 0
mirror of https://git.tukaani.org/xz.git synced 2024-04-04 12:36:23 +02:00

Rearranged testing of GCC-specific flags.

This commit is contained in:
Lasse Collin 2008-01-05 19:42:04 +02:00
parent d160ee3259
commit 072927905a

View file

@ -545,13 +545,29 @@ if test -n "$GCC" ; then
# * -Winline, -Wdisabled-optimization, -Wunsafe-loop-optimizations # * -Winline, -Wdisabled-optimization, -Wunsafe-loop-optimizations
# don't seem so useful here; at least the last one gives some # don't seem so useful here; at least the last one gives some
# warnings which are not bugs. # warnings which are not bugs.
for NEW_FLAG in -Wextra -Wformat=2 -Winit-self -Wstrict-aliasing=2 \ #
-Wfloat-equal -Wshadow -Wpointer-arith \ # The flags are in reverse order below so they end up in "beautiful"
-Wbad-function-cast -Wwrite-strings \ # order on the actual command line.
-Waggregate-return -Wstrict-prototypes \ for NEW_FLAG in \
-Wold-style-definition -Wmissing-prototypes \ -Wredundant-decls \
-Wmissing-declarations -Wmissing-noreturn \ -Wmissing-noreturn \
-Wredundant-decls -Wmissing-declarations \
-Wmissing-prototypes \
-Wold-style-definition \
-Wstrict-prototypes \
-Waggregate-return \
-Wwrite-strings \
-Wbad-function-cast \
-Wpointer-arith \
-Wshadow \
-Wfloat-equal \
-Wstrict-aliasing=2 \
-Winit-self \
-Wformat=2 \
-Wextra \
-Wall \
-pedantic \
-std=c99
do do
AC_MSG_CHECKING([if $CC accepts $NEW_FLAG]) AC_MSG_CHECKING([if $CC accepts $NEW_FLAG])
OLD_CFLAGS="$CFLAGS" OLD_CFLAGS="$CFLAGS"
@ -571,9 +587,6 @@ if test -n "$GCC" ; then
if test "x$enable_werror" = "xyes"; then if test "x$enable_werror" = "xyes"; then
CFLAGS="-Werror $CFLAGS" CFLAGS="-Werror $CFLAGS"
fi fi
# IIRC these work with all GCC versions that support -std=c99:
CFLAGS="-std=c99 -pedantic -Wall $CFLAGS"
fi fi
AM_CONDITIONAL([COND_WNO_UNINITIALIZED], test "x$Wno_uninitialized" = "xyes") AM_CONDITIONAL([COND_WNO_UNINITIALIZED], test "x$Wno_uninitialized" = "xyes")