Search code examples
compiler-errorsg++wxwidgetscompiler-warnings

How to get rid of the property grid warnings?


I always get this warnings: https://gist.githubusercontent.com/jS5t3r/ccb8a6e3db18d5133d37986b8979baef/raw/f4750f5ac3211b0560d27b035d31542877669e07/warnings

I am using

  • ArchLinux
  • gcc (GCC) 6.2.1 20160830
  • wxwidget 3.0

I use those flags for compilng

WXWIDGETSFLAGS=`wx-config --gl-libs --cxxflags --libs std stc propgrid richtext` 

Warnings:

g++ `wx-config --gl-libs --cxxflags --libs std stc propgrid richtext`  -std=c++11 -Wall -Iinclude  source/wxwidget/GUIMemLayMgr.h source/wxwidget/gui.h source/wxwidget/GUIMemLayMgr.cpp source/wxwidget/gui.cpp  source/wxwidget/main.cpp -o output/wxwidget
In file included from /usr/include/wx-3.0/wx/propgrid/propgrid.h:26:0,
             from source/wxwidget/gui.h:31,
             from source/wxwidget/GUIMemLayMgr.h:9:
/usr/include/wx-3.0/wx/propgrid/property.h: In member function 'void  wxPGChoices::Set(const wxArrayString&, const wxArrayInt&)':
/usr/include/wx-3.0/wx/propgrid/property.h:1049:22: warning: the compiler can assume that the address of 'values' will always evaluate to 'true' [-Waddress]
     if ( &values )
                  ^
/usr/include/wx-3.0/wx/propgrid/property.h:1049:22: warning: the compiler can assume that the address of 'values' will always evaluate to 'true' [-Waddress]
In file included from /usr/include/wx-3.0/wx/propgrid/propgrid.h:26:0,
             from source/wxwidget/gui.h:31:
/usr/include/wx-3.0/wx/propgrid/property.h: In member function 'void wxPGChoices::Set(const wxArrayString&, const wxArrayInt&)':
/usr/include/wx-3.0/wx/propgrid/property.h:1049:22: warning: the compiler can assume that the address of 'values' will always evaluate to 'true' [-Waddress]
     if ( &values )
                  ^
/usr/include/wx-3.0/wx/propgrid/property.h:1049:22: warning: the compiler can assume that the address of 'values' will always evaluate to 'true' [-Waddress]
In file included from /usr/include/wx-3.0/wx/propgrid/propgrid.h:26:0,
             from source/wxwidget/gui.h:31,
             from source/wxwidget/GUIMemLayMgr.h:9,
             from source/wxwidget/GUIMemLayMgr.cpp:1:
/usr/include/wx-3.0/wx/propgrid/property.h: In member function 'void wxPGChoices::Set(const wxArrayString&, const wxArrayInt&)':
/usr/include/wx-3.0/wx/propgrid/property.h:1049:22: warning: the compiler  can assume that the address of 'values' will always evaluate to 'true' [-Waddress]
     if ( &values )
                  ^
/usr/include/wx-3.0/wx/propgrid/property.h:1049:22: warning: the compiler can assume that the address of 'values' will always evaluate to 'true' [-Waddress]
In file included from /usr/include/wx-3.0/wx/propgrid/propgrid.h:26:0,
             from source/wxwidget/gui.h:31,
             from source/wxwidget/gui.cpp:8:
/usr/include/wx-3.0/wx/propgrid/property.h: In member function 'void   wxPGChoices::Set(const wxArrayString&, const wxArrayInt&)':
/usr/include/wx-3.0/wx/propgrid/property.h:1049:22: warning: the  compiler can assume that the address of 'values' will always evaluate to 'true' [-Waddress]
     if ( &values )
                  ^
/usr/include/wx-3.0/wx/propgrid/property.h:1049:22: warning: the compiler can assume that the address of 'values' will always evaluate to 'true' [-Waddress]
In file included from /usr/include/wx-3.0/wx/propgrid/propgrid.h:26:0,
             from source/wxwidget/gui.h:31,
             from source/wxwidget/main.cpp:22:
/usr/include/wx-3.0/wx/propgrid/property.h: In member function 'void wxPGChoices::Set(const wxArrayString&, const wxArrayInt&)':
/usr/include/wx-3.0/wx/propgrid/property.h:1049:22: warning: the compiler can assume that the address of 'values' will always evaluate to 'true' [-Waddress]
     if ( &values )
                  ^
/usr/include/wx-3.0/wx/propgrid/property.h:1049:22: warning: the compiler can assume that the address of 'values' will always evaluate to 'true' [-Waddress]

Solution

  • That was fixed in Optimize wxPGChoices::Set method commit, which was after 3.0.2. To use it you need to get latest 3.0 branch from git or 3.1.0 version - basically anything after that commit.