lmi
[Top][All Lists]
Advanced

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

[lmi] wx-dependent gcc warnings [Was: master 1372a42 6/7: Use '-isystem'


From: Greg Chicares
Subject: [lmi] wx-dependent gcc warnings [Was: master 1372a42 6/7: Use '-isystem' to suppress warnings in third-party headers]
Date: Tue, 9 Jun 2020 11:41:24 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

On 2020-06-08 23:14, Greg Chicares wrote:
[...]
>> Are there any other macros that
>> are problematic from this point of view?

A systematic (but perhaps not very useful) answer is given below.

> And of course it's easy to find all diagnostics that are inhibited
> by '-isystem' for wx, by moving one line:

[...put $(wx_include_paths) in lmi_include_directories instead
of sys_include_directories...]

> and then rebuilding after 'make clobber'.

I did that just now with gcc-8.3, using the patch below[0] that also
blocks a warning pragma. Here's a summary for lmi's 'make install':

<errors.txt grep 'Werror=' |sed -e's/^.*Werror=//' |sort | uniq -c
    977 cast-qual]
     56 double-promotion]
      2 extra-semi]
     56 format-nonliteral]
     95 noexcept]
   7890 suggest-override]
   2175 useless-cast]
   6226 zero-as-null-pointer-constant]

Ninety-seven macros[1] are mentioned in the same log:

<errors.txt grep 'note: in expansion of macro' |sed -e's/^.*of macro//' |sort | 
uniq -c
[output in footnote]

but that's probably not helpful because, as this one example shows,
a "useless cast" is diagnosed in one member function but reached
through a series of four macros:

/opt/lmi/local/include/wx-3.1/wx/unichar.h: In member function ‘bool 
wxUniChar::operator!=(unsigned int) const’:
/opt/lmi/local/include/wx-3.1/wx/unichar.h:159:65: error: useless cast to type 
‘wxUniChar::value_type’ {aka ‘unsigned int’} [-Werror=useless-cast]
     bool operator op(T c) const { return m_value op (value_type)c; }
                                                                 ^
/opt/lmi/local/include/wx-3.1/wx/defs.h:1053:5: note: in expansion of macro 
‘wxDEFINE_UNICHAR_CMP_WITH_INT’
     m(unsigned int, arg) \
     ^
/opt/lmi/local/include/wx-3.1/wx/unichar.h:166:5: note: in expansion of macro 
‘wxDO_FOR_INT_TYPES_1’
     wxDO_FOR_INT_TYPES_1(wxDEFINE_UNICHAR_CMP_WITH_INT, op)
     ^~~~~~~~~~~~~~~~~~~~
/opt/lmi/local/include/wx-3.1/wx/defs.h:739:11: note: in expansion of macro 
‘wxDEFINE_UNICHAR_OPERATOR’
     m(==) m(!=) m(>=) m(<=) m(>) m(<)
           ^
/opt/lmi/local/include/wx-3.1/wx/unichar.h:168:5: note: in expansion of macro 
‘wxFOR_ALL_COMPARISONS’
     wxFOR_ALL_COMPARISONS(wxDEFINE_UNICHAR_OPERATOR)
     ^~~~~~~~~~~~~~~~~~~~~

---------

[0] "the patch below":

diff --git a/pchfile_wx.hpp b/pchfile_wx.hpp
index 5051610f..6d4d8e37 100644
--- a/pchfile_wx.hpp
+++ b/pchfile_wx.hpp
@@ -35,7 +35,7 @@
 // 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__ && !defined __clang__
-#   pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
+//#   pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
 #endif // defined __GNUC__ && !defined __clang__
 
 #if defined LMI_COMPILER_USES_PCH && !defined LMI_IGNORE_PCH
diff --git a/workhorse.make b/workhorse.make
index bfef423c..4d1ba5d7 100644
--- a/workhorse.make
+++ b/workhorse.make
@@ -299,10 +299,10 @@ lmi_include_directories := \
   $(srcdir) \
   $(srcdir)/tools/pete-2.1.1 \
   $(overriding_include_directories) \
+  $(wx_include_paths) \
 
 sys_include_directories := \
   $(compiler_include_directory) \
-  $(wx_include_paths) \
   /opt/lmi/third_party/include \
   /opt/lmi/third_party/src \
   $(localincludedir) \

---------

[1] "Ninety-seven macros":

     21  ‘DECLARE_ABSTRACT_CLASS’
      4  ‘DECLARE_CLASS’
     64  ‘DECLARE_DYNAMIC_CLASS’
    106  ‘DECLARE_EVENT_TABLE’
     30  ‘END_EVENT_TABLE’
      6  ‘EVT_BUTTON’
      1  ‘EVT_CHECKBOX’
      4  ‘EVT_CHOICE’
      1  ‘EVT_CLOSE’
      1  ‘EVT_DATAVIEW_ITEM_CONTEXT_MENU’
      1  ‘EVT_DATAVIEW_ITEM_VALUE_CHANGED’
      1  ‘EVT_DROP_FILES’
      1  ‘EVT_KEY_DOWN’
     53  ‘EVT_MENU’
      2  ‘EVT_TREE_SEL_CHANGED’
    112  ‘EVT_UPDATE_UI’
      2  ‘IMPLEMENT_ABSTRACT_CLASS’
      4  ‘IMPLEMENT_CLASS’
     21  ‘IMPLEMENT_DYNAMIC_CLASS’
      1  ‘TAGS_MODULE_BEGIN’
      1  ‘TAGS_MODULE_END’
    550  ‘WXANY_IMPLEMENT_INT_EQ_OP’
    158  ‘WX_DECLARE_EXPORTED_LIST’
    112  ‘WX_DECLARE_LIST_2’
    104  ‘WX_DECLARE_LIST_3’
    728  ‘WX_DECLARE_LIST_WITH_DECL’
    840  ‘WX_DECLARE_LIST_XO’
     18  ‘WX_DECLARE_USER_EXPORTED_LIST’
     56  ‘WX_DEFINE_VARARG_FUNC_SANS_N0’
     56  ‘WX_DEFINE_VARARG_FUNC’
     56  ‘_WX_VARARG_DEFINE_FUNC’
     56  ‘_WX_VARARG_DO_CALL_WCHAR’
     56  ‘_WX_VARARG_DO_CALL’
     56  ‘_WX_VARARG_ITER_10’
     56  ‘_WX_VARARG_ITER_11’
     56  ‘_WX_VARARG_ITER_12’
     56  ‘_WX_VARARG_ITER_13’
     56  ‘_WX_VARARG_ITER_14’
     56  ‘_WX_VARARG_ITER_15’
     56  ‘_WX_VARARG_ITER_16’
     56  ‘_WX_VARARG_ITER_17’
     56  ‘_WX_VARARG_ITER_18’
     56  ‘_WX_VARARG_ITER_19’
     56  ‘_WX_VARARG_ITER_1’
     56  ‘_WX_VARARG_ITER_20’
     56  ‘_WX_VARARG_ITER_21’
     56  ‘_WX_VARARG_ITER_22’
     56  ‘_WX_VARARG_ITER_23’
     56  ‘_WX_VARARG_ITER_24’
     56  ‘_WX_VARARG_ITER_25’
     56  ‘_WX_VARARG_ITER_26’
     56  ‘_WX_VARARG_ITER_27’
     56  ‘_WX_VARARG_ITER_28’
     56  ‘_WX_VARARG_ITER_29’
     56  ‘_WX_VARARG_ITER_2’
     56  ‘_WX_VARARG_ITER_30’
     56  ‘_WX_VARARG_ITER_3’
     56  ‘_WX_VARARG_ITER_4’
     56  ‘_WX_VARARG_ITER_5’
     56  ‘_WX_VARARG_ITER_6’
     56  ‘_WX_VARARG_ITER_7’
     56  ‘_WX_VARARG_ITER_8’
     56  ‘_WX_VARARG_ITER_9’
     56  ‘_WX_VARARG_ITER_IMPL’
     56  ‘_WX_VARARG_ITER’
    205  ‘wxASSERT_MSG’
    205  ‘wxASSERT’
     56  ‘wxCRT_TolowerW’
     56  ‘wxCRT_ToupperW’
   6390  ‘wxDECLARE_ABSTRACT_CLASS’
    112  ‘wxDECLARE_CLASS_INFO_ITERATORS’
    499  ‘wxDECLARE_CLASS’
   2421  ‘wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN’
    516  ‘wxDECLARE_DYNAMIC_CLASS_NO_COPY’
   5027  ‘wxDECLARE_DYNAMIC_CLASS’
    183  ‘wxDECLARE_EVENT_TABLE_ENTRY’
     30  ‘wxDECLARE_EVENT_TABLE_TERMINATOR’
   1144  ‘wxDECLARE_EVENT_TABLE’
    336  ‘wxDEFINE_UNICHAR_CMP_WITH_INT’
    336  ‘wxDEFINE_UNICHAR_OPERATOR’
    336  ‘wxDO_FOR_INT_TYPES_1’
    112  ‘wxDO_FOR_INT_TYPES’
     30  ‘wxEND_EVENT_TABLE’
     53  ‘wxEVT_ANY’
    336  ‘wxFOR_ALL_COMPARISONS’
      6  ‘wxIMPLEMENT_ABSTRACT_CLASS’
     28  ‘wxIMPLEMENT_CLASS_COMMON1’
     28  ‘wxIMPLEMENT_CLASS_COMMON’
      4  ‘wxIMPLEMENT_CLASS’
     22  ‘wxIMPLEMENT_DYNAMIC_CLASS’
     56  ‘wxUNICHAR_DEFINE_CTOR’
     56  ‘wxUNICHAR_DEFINE_OPERATOR_EQUAL’
      2  ‘wx__DECLARE_DATAVIEWEVT’
      3  ‘wx__DECLARE_EVT0’
    183  ‘wx__DECLARE_EVT1’
    183  ‘wx__DECLARE_EVT2’
      2  ‘wx__DECLARE_TREEEVT’



reply via email to

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