llvm.org GIT mirror llvm / d2f8216
Disable -Wuninitialized for gcc If the compiler is gcc, disable variants of -Wuninitialized depending on the gcc version. This gets a lot of false positive warnings out of the build. Generate a new configure for the gcc -Wno-uninitialized fix. Pick up -Wno-uninitialized from configure Add the option -Wno[-maybe]-uninitialized as determined by configure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172006 91177308-0d34-0410-b5e6-96231b3b80d8 David Greene 6 years ago
4 changed file(s) with 53 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
357357 NO_VARIADIC_MACROS = @NO_VARIADIC_MACROS@
358358 # -Wcovered-switch-default
359359 COVERED_SWITCH_DEFAULT = @COVERED_SWITCH_DEFAULT@
360 # -Wno-uninitialized
361 NO_UNINITIALIZED = @NO_UNINITIALIZED@
362 # -Wno-maybe-uninitialized
363 NO_MAYBE_UNINITIALIZED = @NO_MAYBE_UNINITIALIZED@
360364
361365 # Was polly found in tools/polly?
362366 LLVM_HAS_POLLY = @LLVM_HAS_POLLY@
667667 CompileCommonOpts += -pedantic -Wno-long-long
668668 endif
669669 CompileCommonOpts += -Wall -W -Wno-unused-parameter -Wwrite-strings \
670 $(EXTRA_OPTIONS) $(COVERED_SWITCH_DEFAULT)
670 $(EXTRA_OPTIONS) $(COVERED_SWITCH_DEFAULT) \
671 $(NO_UNINITIALIZED) $(NO_MAYBE_UNINITIALIZED)
671672 # Enable cast-qual for C++; the workaround is to use const_cast.
672673 CXX.Flags += -Wcast-qual
673674
12561256 CXX_FLAG_CHECK(NO_VARIADIC_MACROS, [-Wno-variadic-macros])
12571257 CXX_FLAG_CHECK(NO_MISSING_FIELD_INITIALIZERS, [-Wno-missing-field-initializers])
12581258 CXX_FLAG_CHECK(COVERED_SWITCH_DEFAULT, [-Wcovered-switch-default])
1259 AC_MSG_RESULT([$NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS $COVERED_SWITCH_DEFAULT])
1259 dnl GCC's potential uninitialized use analysis is weak and presents lots of
1260 dnl false positives, so disable it.
1261 if test "$GXX" = "yes"
1262 then
1263 CXX_FLAG_CHECK(NO_MAYBE_UNINITIALIZED, [-Wno-maybe-uninitialized])
1264 dnl gcc 4.7 introduced -Wmaybe-uninitialized to distinguish cases which are
1265 dnl known to be uninitialized from cases which might be uninitialized. We
1266 dnl still want to catch the first kind of errors.
1267 if test "$NO_MAYBE_UNINITIALIZED" != "-Wno-maybe-uninitialized"
1268 then
1269 CXX_FLAG_CHECK(NO_UNINITIALIZED, [-Wno-uninitialized])
1270 else
1271 dnl AC_SUBST doesn't work with empty strings.
1272 NO_UNINITIALIZED=
1273 fi
1274 else
1275 NO_UNINITIALIZED=
1276 NO_MAYBE_UNINITIALIZED=
1277 fi
1278 AC_MSG_RESULT([$NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS $COVERED_SWITCH_DEFAULT $NO_UNINITIALIZED $NO_MAYBE_UNINITIALIZED])
1279
12601280
12611281 dnl===-----------------------------------------------------------------------===
12621282 dnl===
766766 NO_VARIADIC_MACROS
767767 NO_MISSING_FIELD_INITIALIZERS
768768 COVERED_SWITCH_DEFAULT
769 NO_MAYBE_UNINITIALIZED
770 NO_UNINITIALIZED
769771 USE_UDIS86
770772 USE_OPROFILE
771773 USE_INTEL_JITEVENTS
1048410486 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1048510487 lt_status=$lt_dlunknown
1048610488 cat > conftest.$ac_ext <
10487 #line 10488 "configure"
10489 #line 10490 "configure"
1048810490 #include "confdefs.h"
1048910491
1049010492 #if HAVE_DLFCN_H
1224512247
1224612248 COVERED_SWITCH_DEFAULT=`$CXX -Werror -Wcovered-switch-default -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wcovered-switch-default`
1224712249
12248 { echo "$as_me:$LINENO: result: $NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS $COVERED_SWITCH_DEFAULT" >&5
12249 echo "${ECHO_T}$NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS $COVERED_SWITCH_DEFAULT" >&6; }
12250 if test "$GXX" = "yes"
12251 then
12252 NO_MAYBE_UNINITIALIZED=`$CXX -Werror -Wno-maybe-uninitialized -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wno-maybe-uninitialized`
12253
12254 if test "$NO_MAYBE_UNINITIALIZED" != "-Wno-maybe-uninitialized"
12255 then
12256 NO_UNINITIALIZED=`$CXX -Werror -Wno-uninitialized -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wno-uninitialized`
12257
12258 else
12259 NO_UNINITIALIZED=
12260 fi
12261 else
12262 NO_UNINITIALIZED=
12263 NO_MAYBE_UNINITIALIZED=
12264 fi
12265 { echo "$as_me:$LINENO: result: $NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS $COVERED_SWITCH_DEFAULT $NO_UNINITIALIZED $NO_MAYBE_UNINITIALIZED" >&5
12266 echo "${ECHO_T}$NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS $COVERED_SWITCH_DEFAULT $NO_UNINITIALIZED $NO_MAYBE_UNINITIALIZED" >&6; }
12267
1225012268
1225112269
1225212270
2230222320 NO_VARIADIC_MACROS!$NO_VARIADIC_MACROS$ac_delim
2230322321 NO_MISSING_FIELD_INITIALIZERS!$NO_MISSING_FIELD_INITIALIZERS$ac_delim
2230422322 COVERED_SWITCH_DEFAULT!$COVERED_SWITCH_DEFAULT$ac_delim
22323 NO_MAYBE_UNINITIALIZED!$NO_MAYBE_UNINITIALIZED$ac_delim
22324 NO_UNINITIALIZED!$NO_UNINITIALIZED$ac_delim
2230522325 USE_UDIS86!$USE_UDIS86$ac_delim
2230622326 USE_OPROFILE!$USE_OPROFILE$ac_delim
2230722327 USE_INTEL_JITEVENTS!$USE_INTEL_JITEVENTS$ac_delim
2232922349 ENABLE_VISIBILITY_INLINES_HIDDEN!$ENABLE_VISIBILITY_INLINES_HIDDEN$ac_delim
2233022350 RPATH!$RPATH$ac_delim
2233122351 RDYNAMIC!$RDYNAMIC$ac_delim
22332 program_prefix!$program_prefix$ac_delim
22333 LIBOBJS!$LIBOBJS$ac_delim
2233422352 _ACEOF
2233522353
2233622354 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
2237222390 ac_delim='%!_!# '
2237322391 for ac_last_try in false false false false false :; do
2237422392 cat >conf$$subs.sed <<_ACEOF
22393 program_prefix!$program_prefix$ac_delim
22394 LIBOBJS!$LIBOBJS$ac_delim
2237522395 LTLIBOBJS!$LTLIBOBJS$ac_delim
2237622396 _ACEOF
2237722397
22378 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 1; then
22398 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 3; then
2237922399 break
2238022400 elif $ac_last_try; then
2238122401 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5