llvm.org GIT mirror llvm / 33177f5
Enable -Wcovered-switch-default as it matches the switch style used in llvm. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151609 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 7 years ago
9 changed file(s) with 30 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
336336 NO_MISSING_FIELD_INITIALIZERS = @NO_MISSING_FIELD_INITIALIZERS@
337337 # -Wno-variadic-macros
338338 NO_VARIADIC_MACROS = @NO_VARIADIC_MACROS@
339 # -Wcovered-switch-default
340 COVERED_SWITCH_DEFAULT = @COVERED_SWITCH_DEFAULT@
339341
340342 # Was polly found in tools/polly?
341343 LLVM_HAS_POLLY = @LLVM_HAS_POLLY@
649649 CompileCommonOpts += -pedantic -Wno-long-long
650650 endif
651651 CompileCommonOpts += -Wall -W -Wno-unused-parameter -Wwrite-strings \
652 $(EXTRA_OPTIONS)
652 $(EXTRA_OPTIONS) $(COVERED_SWITCH_DEFAULT)
653653 # Enable cast-qual for C++; the workaround is to use const_cast.
654654 CXX.Flags += -Wcast-qual
655655
11141114 AC_MSG_CHECKING([optional compiler flags])
11151115 CXX_FLAG_CHECK(NO_VARIADIC_MACROS, [-Wno-variadic-macros])
11161116 CXX_FLAG_CHECK(NO_MISSING_FIELD_INITIALIZERS, [-Wno-missing-field-initializers])
1117 AC_MSG_RESULT([$NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS])
1117 CXX_FLAG_CHECK(COVERED_SWITCH_DEFAULT, [-Wcovered-switch-default])
1118 AC_MSG_RESULT([$NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS $COVERED_SWITCH_DEFAULT])
11181119
11191120 dnl===-----------------------------------------------------------------------===
11201121 dnl===
181181 if (LLVM_ENABLE_PEDANTIC)
182182 add_llvm_definitions( -pedantic -Wno-long-long )
183183 endif (LLVM_ENABLE_PEDANTIC)
184 check_cxx_compiler_flag("-Wcovered-switch-default" SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG)
185 if( SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG )
186 add_llvm_definitions( -Wcovered-switch-default )
187 endif()
184188 endif (LLVM_ENABLE_WARNINGS)
185189 if (LLVM_ENABLE_WERROR)
186190 add_llvm_definitions( -Werror )
764764 LIBADD_DL
765765 NO_VARIADIC_MACROS
766766 NO_MISSING_FIELD_INITIALIZERS
767 COVERED_SWITCH_DEFAULT
767768 USE_UDIS86
768769 USE_OPROFILE
769770 HAVE_PTHREAD
1046210463 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1046310464 lt_status=$lt_dlunknown
1046410465 cat > conftest.$ac_ext <
10465 #line 10466 "configure"
10466 #line 10467 "configure"
1046610467 #include "confdefs.h"
1046710468
1046810469 #if HAVE_DLFCN_H
1222112222
1222212223 NO_MISSING_FIELD_INITIALIZERS=`$CXX -Wno-missing-field-initializers -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wno-missing-field-initializers`
1222312224
12224 { echo "$as_me:$LINENO: result: $NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS" >&5
12225 echo "${ECHO_T}$NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS" >&6; }
12225 COVERED_SWITCH_DEFAULT=`$CXX -Wcovered-switch-default -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wcovered-switch-default`
12226
12227 { echo "$as_me:$LINENO: result: $NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS $COVERED_SWITCH_DEFAULT" >&5
12228 echo "${ECHO_T}$NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS $COVERED_SWITCH_DEFAULT" >&6; }
1222612229
1222712230
1222812231
2197321976 LIBADD_DL!$LIBADD_DL$ac_delim
2197421977 NO_VARIADIC_MACROS!$NO_VARIADIC_MACROS$ac_delim
2197521978 NO_MISSING_FIELD_INITIALIZERS!$NO_MISSING_FIELD_INITIALIZERS$ac_delim
21979 COVERED_SWITCH_DEFAULT!$COVERED_SWITCH_DEFAULT$ac_delim
2197621980 USE_UDIS86!$USE_UDIS86$ac_delim
2197721981 USE_OPROFILE!$USE_OPROFILE$ac_delim
2197821982 HAVE_PTHREAD!$HAVE_PTHREAD$ac_delim
2200022004 LTLIBOBJS!$LTLIBOBJS$ac_delim
2200122005 _ACEOF
2200222006
22003 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 91; then
22007 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 92; then
2200422008 break
2200522009 elif $ac_last_try; then
2200622010 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
300300 NO_MISSING_FIELD_INITIALIZERS = @NO_MISSING_FIELD_INITIALIZERS@
301301 # -Wno-variadic-macros
302302 NO_VARIADIC_MACROS = @NO_VARIADIC_MACROS@
303 # -Wcovered-switch-default
304 COVERED_SWITCH_DEFAULT = @COVERED_SWITCH_DEFAULT@
303305
304306 # Was polly found in tools/polly?
305307 LLVM_HAS_POLLY = @LLVM_HAS_POLLY@
570570 CompileCommonOpts += -pedantic -Wno-long-long
571571 endif
572572 CompileCommonOpts += -Wall -W -Wno-unused-parameter -Wwrite-strings \
573 $(EXTRA_OPTIONS)
573 $(EXTRA_OPTIONS) $(COVERED_SWITCH_DEFAULT)
574574 # Enable cast-qual for C++; the workaround is to use const_cast.
575575 CXX.Flags += -Wcast-qual
576576
10181018 AC_MSG_CHECKING([optional compiler flags])
10191019 CXX_FLAG_CHECK(NO_VARIADIC_MACROS, [-Wno-variadic-macros])
10201020 CXX_FLAG_CHECK(NO_MISSING_FIELD_INITIALIZERS, [-Wno-missing-field-initializers])
1021 AC_MSG_RESULT([$NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS])
1021 CXX_FLAG_CHECK(COVERED_SWITCH_DEFAULT, [-Wcovered-switch-default])
1022 AC_MSG_RESULT([$NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS $COVERED_SWITCH_DEFAULT])
10221023
10231024 dnl===-----------------------------------------------------------------------===
10241025 dnl===
761761 LIBADD_DL
762762 NO_VARIADIC_MACROS
763763 NO_MISSING_FIELD_INITIALIZERS
764 COVERED_SWITCH_DEFAULT
764765 USE_UDIS86
765766 USE_OPROFILE
766767 HAVE_PTHREAD
1036410365 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1036510366 lt_status=$lt_dlunknown
1036610367 cat > conftest.$ac_ext <
10367 #line 10368 "configure"
10368 #line 10369 "configure"
1036810369 #include "confdefs.h"
1036910370
1037010371 #if HAVE_DLFCN_H
1212312124
1212412125 NO_MISSING_FIELD_INITIALIZERS=`$CXX -Wno-missing-field-initializers -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wno-missing-field-initializers`
1212512126
12126 { echo "$as_me:$LINENO: result: $NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS" >&5
12127 echo "${ECHO_T}$NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS" >&6; }
12127 COVERED_SWITCH_DEFAULT=`$CXX -Wcovered-switch-default -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wcovered-switch-default`
12128
12129 { echo "$as_me:$LINENO: result: $NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS $COVERED_SWITCH_DEFAULT" >&5
12130 echo "${ECHO_T}$NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS $COVERED_SWITCH_DEFAULT" >&6; }
1212812131
1212912132
1213012133
2181521818 LIBADD_DL!$LIBADD_DL$ac_delim
2181621819 NO_VARIADIC_MACROS!$NO_VARIADIC_MACROS$ac_delim
2181721820 NO_MISSING_FIELD_INITIALIZERS!$NO_MISSING_FIELD_INITIALIZERS$ac_delim
21821 COVERED_SWITCH_DEFAULT!$COVERED_SWITCH_DEFAULT$ac_delim
2181821822 USE_UDIS86!$USE_UDIS86$ac_delim
2181921823 USE_OPROFILE!$USE_OPROFILE$ac_delim
2182021824 HAVE_PTHREAD!$HAVE_PTHREAD$ac_delim
2184221846 LTLIBOBJS!$LTLIBOBJS$ac_delim
2184321847 _ACEOF
2184421848
21845 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 90; then
21849 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 91; then
2184621850 break
2184721851 elif $ac_last_try; then
2184821852 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5