scons: Enable -Wextra by default
Make best use of the compiler, and enable -Wextra as well as -Wall. There are a few issues that had to be resolved, but they are all trivial.
This commit is contained in:
@@ -1018,11 +1018,6 @@ def makeEnv(env, label, objsfx, strip = False, **kwargs):
|
||||
# the SWIG generated code
|
||||
swig_env.Append(CCFLAGS=['-Wno-unused-label', '-Wno-unused-value'])
|
||||
|
||||
# Add additional warnings here that should not be applied to
|
||||
# the SWIG generated code
|
||||
new_env.Append(CXXFLAGS=['-Wmissing-declarations',
|
||||
'-Wdelete-non-virtual-dtor'])
|
||||
|
||||
if env['GCC']:
|
||||
# Depending on the SWIG version, we also need to supress
|
||||
# warnings about uninitialized variables and missing field
|
||||
@@ -1030,7 +1025,8 @@ def makeEnv(env, label, objsfx, strip = False, **kwargs):
|
||||
swig_env.Append(CCFLAGS=['-Wno-uninitialized',
|
||||
'-Wno-missing-field-initializers',
|
||||
'-Wno-unused-but-set-variable',
|
||||
'-Wno-maybe-uninitialized'])
|
||||
'-Wno-maybe-uninitialized',
|
||||
'-Wno-type-limits'])
|
||||
|
||||
# Only gcc >= 4.9 supports UBSan, so check both the version
|
||||
# and the command-line option before adding the compiler and
|
||||
@@ -1041,13 +1037,9 @@ def makeEnv(env, label, objsfx, strip = False, **kwargs):
|
||||
new_env.Append(LINKFLAGS='-fsanitize=undefined')
|
||||
|
||||
if env['CLANG']:
|
||||
swig_env.Append(CCFLAGS=[
|
||||
# Some versions of SWIG can return uninitialized values
|
||||
'-Wno-sometimes-uninitialized',
|
||||
# Register storage is requested in a lot of places in
|
||||
# SWIG-generated code.
|
||||
'-Wno-deprecated-register',
|
||||
])
|
||||
swig_env.Append(CCFLAGS=['-Wno-sometimes-uninitialized',
|
||||
'-Wno-deprecated-register',
|
||||
'-Wno-tautological-compare'])
|
||||
|
||||
# All supported clang versions have support for UBSan, so if
|
||||
# asked to use it, append the compiler and linker flags.
|
||||
|
||||
Reference in New Issue
Block a user