lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 9ef5990 2/6: Disable gcc -Wcast-qual warning


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 9ef5990 2/6: Disable gcc -Wcast-qual warning for wx in the code, not makefile
Date: Mon, 13 Mar 2017 09:46:14 -0400 (EDT)

branch: master
commit 9ef5990e38693a3044361a2f3c3fb0df87e93984
Author: Vadim Zeitlin <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Disable gcc -Wcast-qual warning for wx in the code, not makefile
    
    Don't use imperfect (as indicated by the comment explaining this
    technique in the makefile itself as well as the experience described in
    http://lists.nongnu.org/archive/html/lmi/2017-03/msg00025.html)
    heuristic for determining the files including wxWidgets headers in the
    makefile and rely, instead, on the already enforced rule that all source
    file using wxWidgets must include pchfile_wx.hpp, even if precompiled
    headers are not used.
    
    This allows us to simply disable the warning at the code level, using a
    gcc-specific pragma, rather than doing it in an implicit and error-prone
    way in the makefiles.
---
 pchfile_wx.hpp |  7 +++++++
 workhorse.make | 43 -------------------------------------------
 2 files changed, 7 insertions(+), 43 deletions(-)

diff --git a/pchfile_wx.hpp b/pchfile_wx.hpp
index 2cfcd54..1aa210b 100644
--- a/pchfile_wx.hpp
+++ b/pchfile_wx.hpp
@@ -31,6 +31,13 @@
 #ifndef pchfile_wx_hpp
 #define pchfile_wx_hpp
 
+// Even if precompiled headers are not really being used, use this header to
+// disable some warnings which are enabled for the rest of lmi code but have to
+// be disabled for the code using wxWidgets as they occur in wxWidgets headers.
+#if defined __GNUC__
+#   pragma GCC diagnostic ignored "-Wcast-qual"
+#endif // defined __GNUC__
+
 #if defined LMI_COMPILER_USES_PCH && !defined LMI_IGNORE_PCH
 
 #   define LMI_OKAY_TO_INCLUDE_PCHLIST_HPP
diff --git a/workhorse.make b/workhorse.make
index d4f28a4..1e0dca2 100644
--- a/workhorse.make
+++ b/workhorse.make
@@ -356,46 +356,6 @@ physical_closure_files := \
 
 
################################################################################
 
-# Files that depend on wx, which can't use the strictest gcc warnings.
-
-# Files are deemed to depend on wx iff they contain 'include *<wx/'.
-# This heuristic isn't foolproof because wx headers might be included
-# indirectly. Include an innocuous header like <wx/version.h> in files
-# for which it fails.
-
-wx_dependent_objects := \
-  $(sort \
-    $(addsuffix .o,\
-      $(basename \
-        $(notdir \
-          $(shell $(GREP) \
-            --files-with-matches \
-            'include *<wx/' \
-            $(src_dir)/*.?pp \
-          ) \
-        ) \
-      ) \
-    ) \
-  ) \
-
-wx_dependent_physical_closure_files := \
-  $(sort \
-    $(addsuffix .physical_closure,\
-      $(notdir \
-        $(shell $(GREP) \
-          --files-with-matches \
-          'include *<wx/' \
-          $(wildcard \
-            $(addprefix $(src_dir)/,*.h *.hpp *.tpp *.xpp \
-            ) \
-          ) \
-        ) \
-      ) \
-    ) \
-  ) \
-
-################################################################################
-
 # Warning options for gcc.
 
 c_standard   := -std=c99
@@ -487,9 +447,6 @@ ifeq (safestdlib,$(findstring safestdlib,$(build_type)))
   endif
 endif
 
-$(wx_dependent_objects):                gcc_common_extra_warnings :=
-$(wx_dependent_physical_closure_files): gcc_common_extra_warnings :=
-
 # Boost didn't remove an unused parameter in this file, which also
 # seems to contain a "maybe-uninitialized" variable--see:
 #   http://lists.nongnu.org/archive/html/lmi/2016-12/msg00080.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]