llvm.org GIT mirror llvm / d31bd24
configure: when performing a compiler feature test for a -Wno-foo flag, attempt to use -Wfoo instead of -Wno-foo. This works around a bug in some versions of gcc, where it will silently accept an unknown -Wno-foo option, but will generate an error for a compile which uses -Wno-foo if that compile also triggers any warnings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174770 91177308-0d34-0410-b5e6-96231b3b80d8 Richard Smith 6 years ago
2 changed file(s) with 12 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
0 AC_DEFUN([CXX_FLAG_CHECK],
1 [AC_SUBST($1, `$CXX -Werror $2 -fsyntax-only -xc /dev/null 2>/dev/null && echo $2`)])
1 [AC_SUBST($1, `$CXX -Werror patsubst($2, [^-Wno-], [-W]) -fsyntax-only -xc /dev/null 2>/dev/null && echo $2`)])
87188718 fi
87198719
87208720
8721
8722
8723 if test x"${enable_ltdl_install-no}" != xno; then
8721 if test x"${enable_ltdl_install-no}" != xno; then
87248722 INSTALL_LTDL_TRUE=
87258723 INSTALL_LTDL_FALSE='#'
87268724 else
87288726 INSTALL_LTDL_FALSE=
87298727 fi
87308728
8731
8732
8733 if test x"${enable_ltdl_convenience-no}" != xno; then
8729 if test x"${enable_ltdl_convenience-no}" != xno; then
87348730 CONVENIENCE_LTDL_TRUE=
87358731 CONVENIENCE_LTDL_FALSE='#'
87368732 else
1049710493 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1049810494 lt_status=$lt_dlunknown
1049910495 cat > conftest.$ac_ext <
10500 #line 10501 "configure"
10496 #line 10497 "configure"
1050110497 #include "confdefs.h"
1050210498
1050310499 #if HAVE_DLFCN_H
1226012256
1226112257 { echo "$as_me:$LINENO: checking optional compiler flags" >&5
1226212258 echo $ECHO_N "checking optional compiler flags... $ECHO_C" >&6; }
12263 NO_VARIADIC_MACROS=`$CXX -Werror -Wno-variadic-macros -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wno-variadic-macros`
12264
12265 NO_MISSING_FIELD_INITIALIZERS=`$CXX -Werror -Wno-missing-field-initializers -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wno-missing-field-initializers`
12266
12267 NO_NESTED_ANON_TYPES=`$CXX -Werror -Wno-nested-anon-types -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wno-nested-anon-types`
12259 NO_VARIADIC_MACROS=`$CXX -Werror -Wvariadic-macros -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wno-variadic-macros`
12260
12261 NO_MISSING_FIELD_INITIALIZERS=`$CXX -Werror -Wmissing-field-initializers -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wno-missing-field-initializers`
12262
12263 NO_NESTED_ANON_TYPES=`$CXX -Werror -Wnested-anon-types -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wno-nested-anon-types`
1226812264
1226912265 COVERED_SWITCH_DEFAULT=`$CXX -Werror -Wcovered-switch-default -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wcovered-switch-default`
1227012266
1227112267 if test "$GXX" = "yes"
1227212268 then
12273 NO_MAYBE_UNINITIALIZED=`$CXX -Werror -Wno-maybe-uninitialized -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wno-maybe-uninitialized`
12269 NO_MAYBE_UNINITIALIZED=`$CXX -Werror -Wmaybe-uninitialized -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wno-maybe-uninitialized`
1227412270
1227512271 if test "$NO_MAYBE_UNINITIALIZED" != "-Wno-maybe-uninitialized"
1227612272 then
12277 NO_UNINITIALIZED=`$CXX -Werror -Wno-uninitialized -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wno-uninitialized`
12273 NO_UNINITIALIZED=`$CXX -Werror -Wuninitialized -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wno-uninitialized`
1227812274
1227912275 else
1228012276 gxx_version=`$CXX -dumpversion`
1228712283 NO_UNINITIALIZED=
1228812284 else
1228912285 NO_MAYBE_UNINITIALIZED=
12290 NO_UNINITIALIZED=`$CXX -Werror -Wno-uninitialized -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wno-uninitialized`
12286 NO_UNINITIALIZED=`$CXX -Werror -Wuninitialized -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wno-uninitialized`
1229112287
1229212288 fi
1229312289 fi