diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2016-01-11 05:52:20 -0500 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2016-01-11 05:52:20 -0500 |
commit | 12eb0343784f52994110df7e7fce4a0b639a6ec3 (patch) | |
tree | 12ff1c51b8051bb7e7d889eed499bee0dcd4cd1e /SConstruct | |
parent | 7661f1c2bf2b45603264076fabce2eb42373cd18 (diff) | |
download | gem5-12eb0343784f52994110df7e7fce4a0b639a6ec3.tar.xz |
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.
Diffstat (limited to 'SConstruct')
-rwxr-xr-x | SConstruct | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/SConstruct b/SConstruct index 58f7a356b..eadf5d9d2 100755 --- a/SConstruct +++ b/SConstruct @@ -554,14 +554,12 @@ if main['GCC'] or main['CLANG']: # As gcc and clang share many flags, do the common parts here main.Append(CCFLAGS=['-pipe']) main.Append(CCFLAGS=['-fno-strict-aliasing']) - # Enable -Wall and then disable the few warnings that we - # consistently violate - main.Append(CCFLAGS=['-Wall', '-Wno-sign-compare', '-Wundef']) + # Enable -Wall and -Wextra and then disable the few warnings that + # we consistently violate + main.Append(CCFLAGS=['-Wall', '-Wundef', '-Wextra', + '-Wno-sign-compare', '-Wno-unused-parameter']) # We always compile using C++11 main.Append(CXXFLAGS=['-std=c++11']) - # Add selected sanity checks from -Wextra - main.Append(CXXFLAGS=['-Wmissing-field-initializers', - '-Woverloaded-virtual']) else: print termcap.Yellow + termcap.Bold + 'Error' + termcap.Normal, print "Don't know what compiler options to use for your compiler." @@ -656,14 +654,11 @@ elif main['CLANG']: print 'Error: Unable to determine clang version.' Exit(1) - # clang has a few additional warnings that we disable, - # tautological comparisons are allowed due to unsigned integers - # being compared to constants that happen to be 0, and extraneous + # clang has a few additional warnings that we disable, extraneous # parantheses are allowed due to Ruby's printing of the AST, # finally self assignments are allowed as the generated CPU code # is relying on this - main.Append(CCFLAGS=['-Wno-tautological-compare', - '-Wno-parentheses', + main.Append(CCFLAGS=['-Wno-parentheses', '-Wno-self-assign', # Some versions of libstdc++ (4.8?) seem to # use struct hash and class hash |