x86: changes to apic, keyboard
[gem5.git] / src / SConscript
index 2abe8b2ad9f85a32288af3323b626a28c3790bfc..3e9196cd5e7e21cedb8e4804b9106d6bd3bf1cb2 100755 (executable)
@@ -892,23 +892,36 @@ def makeEnv(label, objsfx, strip = False, **kwargs):
     new_env.Append(**kwargs)
 
     swig_env = new_env.Clone()
-    swig_env.Append(CCFLAGS='-Werror')
+
+    # Both gcc and clang have issues with unused labels and values in
+    # 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')
+
     if env['GCC']:
-        swig_env.Append(CCFLAGS=['-Wno-uninitialized', '-Wno-sign-compare',
-                                 '-Wno-parentheses', '-Wno-unused-label',
-                                 '-Wno-unused-value'])
+        # Depending on the SWIG version, we also need to supress
+        # warnings about uninitialized variables and missing field
+        # initializers.
+        swig_env.Append(CCFLAGS=['-Wno-uninitialized',
+                                 '-Wno-missing-field-initializers'])
+
         if compareVersions(env['GCC_VERSION'], '4.6') >= 0:
             swig_env.Append(CCFLAGS='-Wno-unused-but-set-variable')
 
-        # Add additional warnings here that should not be applied to
-        # the SWIG generated code
-        new_env.Append(CXXFLAGS='-Wmissing-declarations')
+        # If gcc supports it, also warn for deletion of derived
+        # classes with non-virtual desctructors. For gcc >= 4.7 we
+        # also have to disable warnings about the SWIG code having
+        # potentially uninitialized variables.
+        if compareVersions(env['GCC_VERSION'], '4.7') >= 0:
+            new_env.Append(CXXFLAGS='-Wdelete-non-virtual-dtor')
+            swig_env.Append(CCFLAGS='-Wno-maybe-uninitialized')
     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')
+        # Always enable the warning for deletion of derived classes
+        # with non-virtual destructors
+        new_env.Append(CXXFLAGS=['-Wdelete-non-virtual-dtor'])
 
     werror_env = new_env.Clone()
     werror_env.Append(CCFLAGS='-Werror')