summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2013-02-19 05:56:07 -0500
committerAndreas Hansson <andreas.hansson@arm.com>2013-02-19 05:56:07 -0500
commit5eddb6387765240730bfb1c57f481133d3a3c737 (patch)
tree096d1415304e2bcc33832c38bcc9ff77f1a5fdf8 /src
parent319443d42dbed8d6b07b8a2b7a0e565ff5bd8abf (diff)
downloadgem5-5eddb6387765240730bfb1c57f481133d3a3c737.tar.xz
scons: Add warning delete with non-virtual destructor
This patch enables a warning for deleting derived classes that do not have a virtual destructor. The patch merely adds additional checks, and there are currently no cases that had to be fixed.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/SConscript5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/SConscript b/src/SConscript
index 2abe8b2ad..465bae70e 100755
--- a/src/SConscript
+++ b/src/SConscript
@@ -903,12 +903,15 @@ def makeEnv(label, objsfx, strip = False, **kwargs):
# Add additional warnings here that should not be applied to
# the SWIG generated code
new_env.Append(CXXFLAGS='-Wmissing-declarations')
+ if compareVersions(env['GCC_VERSION'], '4.7') >= 0:
+ new_env.Append(CXXFLAGS='-Wdelete-non-virtual-dtor')
if env['CLANG']:
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')
+ new_env.Append(CXXFLAGS=['-Wmissing-declarations',
+ '-Wdelete-non-virtual-dtor'])
werror_env = new_env.Clone()
werror_env.Append(CCFLAGS='-Werror')