Only automatically enable clang extended warnings in version 5+.

This commit is contained in:
Stephen Anthony 2017-10-16 14:39:40 -02:30
parent 5c6fef4760
commit 9b4443d555
2 changed files with 7 additions and 3 deletions

View File

@ -53,7 +53,7 @@ CXXFLAGS+= -Wall -Wextra -Wno-unused-parameter -Wno-ignored-qualifiers
ifdef HAVE_GCC
CXXFLAGS+= -Wno-multichar -Wunused -fno-rtti -Woverloaded-virtual -Wnon-virtual-dtor -std=c++14
endif
ifdef HAVE_CLANG
ifdef CLANG_WARNINGS
CXXFLAGS+= -Weverything -Wno-c++17-extensions -Wno-c++98-compat -Wno-c++98-compat-pedantic \
-Wno-double-promotion -Wno-switch-enum -Wno-conversion -Wno-covered-switch-default \
-Wno-inconsistent-missing-destructor-override \

8
configure vendored
View File

@ -414,12 +414,16 @@ if test "$have_clang" = yes; then
cxx_version="$cxx_version, bad"
cxx_verc_fail=yes
fi
# Only clang >= 5.0 supports extra warnings
if [ $clang_major -ge 5 ]; then
_make_def_CLANG_WARNINGS='CLANG_WARNINGS = 1'
fi
fi
CXXFLAGS="$CXXFLAGS"
_make_def_HAVE_GCC3='HAVE_GCC3 = 1'
add_line_to_config_mk 'CXX_UPDATE_DEP_FLAG = -MMD -MF "$(*D)/$(DEPDIR)/$(*F).d" -MQ "$@" -MP'
_make_def_HAVE_GCC='HAVE_GCC = 1'
_make_def_HAVE_CLANG='HAVE_CLANG = 1'
echo "$cxx_version"
elif test "$have_gcc" = yes; then
@ -817,7 +821,7 @@ PROFILE := $_build_profile
$_make_def_HAVE_GCC
$_make_def_HAVE_GCC3
$_make_def_HAVE_CLANG
$_make_def_CLANG_WARNINGS
INCLUDES += $INCLUDES
OBJS += $OBJS