[gobject-introspection] giscanner: Disable warnings arising from -D_FORTIFY_SOURCE -O0



commit 0ff7ca94a608663649defc72021062de098853a8
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Sat Jan 30 15:44:03 2016 +0100

    giscanner: Disable warnings arising from -D_FORTIFY_SOURCE -O0
    
    Using distutils.ccompiler means that we are forced to use the CFLAGS
    from the system’s Python installation, which may contain
    -D_FORTIFY_SOURCE. The user’s environment-provided CFLAGS may contain
    -O0 (because they are a developer). These two flags cause a warning when
    used together. Silence that warning by passing -Wno-cpp to disable
    warnings from #warning preprocessor statements in the generated C code.
    
    It doesn’t seem to be possible to selectively undefine _FORTIFY_SOURCE
    or to stop using the compiler flags from distutils.sysconfig,
    unfortunately.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=757934

 giscanner/ccompiler.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/giscanner/ccompiler.py b/giscanner/ccompiler.py
index 9b27f0e..574f40c 100644
--- a/giscanner/ccompiler.py
+++ b/giscanner/ccompiler.py
@@ -229,6 +229,12 @@ class CCompiler(object):
             extra_postargs.append('-Wall')
         extra_postargs.append(self._cflags_no_deprecation_warnings)
 
+        # Disable warnings from combining _FORTIFY_SOURCE (from
+        # distutils.sysconfig) and -O0 (potentially provided in CFLAGS by the
+        # user).
+        if isinstance(self.compiler, UnixCCompiler):
+            extra_postargs.append('-Wno-cpp')
+
         includes.extend(include_paths)
         extra_postargs.extend(extra_args)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]