Commits

Stefan Krah committed d536f34

Fix build with 3.x gcc versions.

Comments (0)

Files changed (1)

 
         # Increase warning level for gcc:
         if 'gcc' in cc:
-            extra_compile_args.extend(['-Wextra',
-                                       '-Wno-missing-field-initializers'])
+            cmd = ("echo '' | gcc -Wextra -Wno-missing-field-initializers -E - "
+                   "> /dev/null 2>&1")
+            ret = os.system(cmd)
+            if ret >> 8 == 0:
+                extra_compile_args.extend(['-Wextra',
+                                           '-Wno-missing-field-initializers'])
 
         # Uncomment for extra functionality:
         #define_macros.append(('EXTRA_FUNCTIONALITY', 1))