wscript
changeset 6362 ca7a4f7e24e7
parent 6274 3e8b3f2306c9
--- a/wscript	Wed Jun 16 20:49:41 2010 +0100
+++ b/wscript	Thu Jun 17 09:56:38 2010 +0100
@@ -421,12 +421,18 @@
     conf.env.append_value('CCFLAGS', conf.env['CXXFLAGS'])
     conf.env.append_value('CCDEFINES', conf.env['CXXDEFINES'])
 
-    if env['COMPILER_CXX'] == 'g++' and 'CXXFLAGS' not in os.environ:
-        if conf.check_compilation_flag('-Wno-error=deprecated-declarations', mode='cxx'):
-            env.append_value('CXXFLAGS', '-Wno-error=deprecated-declarations')
-    if env['COMPILER_CC'] == 'gcc' and 'CCFLAGS' not in os.environ:
-        if conf.check_compilation_flag('-Wno-error=deprecated-declarations', mode='cc'):
-            env.append_value('CCFLAGS', '-Wno-error=deprecated-declarations')        
+    def add_gcc_flag(flag):
+        if env['COMPILER_CXX'] == 'g++' and 'CXXFLAGS' not in os.environ:
+            if conf.check_compilation_flag(flag, mode='cxx'):
+                env.append_value('CXXFLAGS', flag)
+        if env['COMPILER_CC'] == 'gcc' and 'CCFLAGS' not in os.environ:
+            if conf.check_compilation_flag(flag, mode='cc'):
+                env.append_value('CCFLAGS', flag)
+
+    add_gcc_flag('-Wno-error=deprecated-declarations')
+    add_gcc_flag('-fstrict-aliasing')
+    add_gcc_flag('-Wstrict-aliasing')
+
 
     # append user defined flags after all our ones
     for (confvar, envvar) in [['CCFLAGS', 'CCFLAGS_EXTRA'],