scons: Use '-Wmissing-field-initializers' on GCC 4.0 and greater only.
authorVinson Lee <vlee@vmware.com>
Sat, 24 Jul 2010 00:24:21 +0000 (17:24 -0700)
committerVinson Lee <vlee@vmware.com>
Sat, 24 Jul 2010 00:24:21 +0000 (17:24 -0700)
scons/gallium.py

index f03716bad8ab4a511191fcf6f275af4fd2e7bf1c..03a4ef58815f1cf434ecaf9a40709f01fd93214c 100644 (file)
@@ -295,7 +295,6 @@ def generate(env):
         # - http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
         ccflags += [
             '-Wall',
-            '-Wmissing-field-initializers',
             '-Wno-long-long',
             '-ffast-math',
             '-fmessage-length=0', # be nice to Eclipse
@@ -304,6 +303,10 @@ def generate(env):
             '-Wmissing-prototypes',
             '-std=gnu99',
         ]
+        if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.0'):
+            ccflags += [
+                '-Wmissing-field-initializers',
+            ]
         if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.2'):
             ccflags += [
                 '-Werror=pointer-arith',