1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

configure: check more compile flags

Check for clobbered (and put few others into same league)
This commit is contained in:
Zdenek Kabelac 2013-10-25 01:00:10 +02:00
parent d95751cb0b
commit 7943a13141
4 changed files with 49 additions and 7 deletions

View File

@ -24,7 +24,6 @@ AC_DEFUN([AC_TRY_CCFLAG],
AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_CC])
ac_save_CFLAGS=$CFLAGS ac_save_CFLAGS=$CFLAGS
CFLAGS=$1 CFLAGS=$1
AC_MSG_RESULT([KOUKEJ $name])
AC_CACHE_CHECK([whether $CC accepts $1 flag], [ac_cv_flag_$2], AC_CACHE_CHECK([whether $CC accepts $1 flag], [ac_cv_flag_$2],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
[AS_VAR_SET([ac_cv_flag_$2], [yes])], [AS_VAR_SET([ac_cv_flag_$2], [yes])],

41
configure vendored
View File

@ -708,6 +708,7 @@ CUNIT_CFLAGS
GENPNG GENPNG
GENHTML GENHTML
LCOV LCOV
HAVE_WCLOBBERED
HAVE_WJUMP HAVE_WJUMP
SACKPT_LIBS SACKPT_LIBS
SACKPT_CFLAGS SACKPT_CFLAGS
@ -8682,8 +8683,6 @@ fi
ac_save_CFLAGS=$CFLAGS ac_save_CFLAGS=$CFLAGS
CFLAGS=-Wjump-misses-init CFLAGS=-Wjump-misses-init
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: KOUKEJ $name" >&5
$as_echo "KOUKEJ $name" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wjump-misses-init flag" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wjump-misses-init flag" >&5
$as_echo_n "checking whether $CC accepts -Wjump-misses-init flag... " >&6; } $as_echo_n "checking whether $CC accepts -Wjump-misses-init flag... " >&6; }
if test "${ac_cv_flag_HAVE_WJUMP+set}" = set; then : if test "${ac_cv_flag_HAVE_WJUMP+set}" = set; then :
@ -8719,6 +8718,44 @@ $as_echo "$ac_cv_flag_HAVE_WJUMP" >&6; }
ac_save_CFLAGS=$CFLAGS
CFLAGS=-Wclobbered
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wclobbered flag" >&5
$as_echo_n "checking whether $CC accepts -Wclobbered flag... " >&6; }
if test "${ac_cv_flag_HAVE_WCLOBBERED+set}" = set; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_flag_HAVE_WCLOBBERED=yes
else
ac_cv_flag_HAVE_WCLOBBERED=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_flag_HAVE_WCLOBBERED" >&5
$as_echo "$ac_cv_flag_HAVE_WCLOBBERED" >&6; }
CFLAGS=$ac_save_CFLAGS
HAVE_WCLOBBERED=$ac_cv_flag_HAVE_WCLOBBERED
if test "HAVE_WCLOBBERED" = yes; then
:
else
:
fi
################################################################################ ################################################################################
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C optimisation flag" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C optimisation flag" >&5
$as_echo_n "checking for C optimisation flag... " >&6; } $as_echo_n "checking for C optimisation flag... " >&6; }

View File

@ -838,6 +838,8 @@ fi
dnl -- Check if compiler supports -Wjump-misses-init dnl -- Check if compiler supports -Wjump-misses-init
AC_TRY_CCFLAG([-Wjump-misses-init], [HAVE_WJUMP], [], []) AC_TRY_CCFLAG([-Wjump-misses-init], [HAVE_WJUMP], [], [])
AC_SUBST(HAVE_WJUMP) AC_SUBST(HAVE_WJUMP)
AC_TRY_CCFLAG([-Wclobbered], [HAVE_WCLOBBERED], [], [])
AC_SUBST(HAVE_WCLOBBERED)
################################################################################ ################################################################################
dnl -- Override optimisation dnl -- Override optimisation

View File

@ -135,16 +135,20 @@ INSTALL_SCRIPT = $(INSTALL) -p $(M_INSTALL_PROGRAM)
WFLAGS += -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings \ WFLAGS += -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings \
-Wmissing-prototypes -Wmissing-declarations -Wnested-externs \ -Wmissing-prototypes -Wmissing-declarations -Wnested-externs \
-Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls \ -Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls \
-Wpointer-arith -Wclobbered -Wempty-body -Wignored-qualifiers \ -Wpointer-arith -Wuninitialized -Wmissing-include-dirs \
-Wmissing-parameter-type -Wold-style-declaration -Woverride-init \ -Wfloat-equal -Wstrict-prototypes \
-Wtype-limits -Wuninitialized -Wmissing-include-dirs -Wsync-nand \
-Wfloat-equal -Wlogical-op -Wstrict-prototypes \
-Wold-style-definition -Wmissing-format-attribute -Wold-style-definition -Wmissing-format-attribute
ifeq ("@HAVE_WJUMP@", "yes") ifeq ("@HAVE_WJUMP@", "yes")
WFLAGS += -Wjump-misses-init WFLAGS += -Wjump-misses-init
endif endif
ifeq ("@HAVE_WCLOBBERED@", "yes")
WFLAGS += -Wclobbered -Wempty-body -Wignored-qualifiers \
-Wmissing-parameter-type -Wold-style-declaration -Woverride-init \
-Wtype-limits -Wsync-nand -Wlogical-op
endif
#WFLAGS += -W -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers #WFLAGS += -W -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers
#WFLAGS += -Wsign-compare -Wunused-parameter -Wmissing-field-initializers #WFLAGS += -Wsign-compare -Wunused-parameter -Wmissing-field-initializers
#WFLAGS += -Wconversion -Wbad-function-cast -Wcast-qual -Waggregate-return -Wpacked #WFLAGS += -Wconversion -Wbad-function-cast -Wcast-qual -Waggregate-return -Wpacked