Compiler errors 如何消除属性网格警告?

Compiler errors 如何消除属性网格警告?,compiler-errors,g++,wxwidgets,compiler-warnings,Compiler Errors,G++,Wxwidgets,Compiler Warnings,我总是收到这样的警告: 我正在使用 ArchLinux 通用条款(gcc)6.2.1 20160830 wxwidget 3.0 我使用这些标志进行编译 WXWIDGETSFLAGS=`wx-config --gl-libs --cxxflags --libs std stc propgrid richtext` 警告: g++ `wx-config --gl-libs --cxxflags --libs std stc propgrid richtext` -std=c++11 -

我总是收到这样的警告:

我正在使用

  • ArchLinux
  • 通用条款(gcc)6.2.1 20160830
  • wxwidget 3.0
我使用这些标志进行编译

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

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]

我将包含从

#include <wx/propgrid/propgrid.h>
#包括

#包括

现在它工作得很好。

这在提交中得到了修复,提交在
3.0.2之后。要使用它,您需要从git获得最新的
3.0
分支或
3.1.0
版本-基本上是在提交之后的任何版本。

在没有看到代码的情况下很难说话。但是,这只是一个警告,如果程序运行正常,您可以忽略。您应该在问题中包含错误消息,而不是依赖外部链接。@Igor我不会忽略警告。这听起来不是正确的方法。更改标题,但不使用与新标题对应的源文件是不正确的。除了前面的评论所说的,这根本不能改变任何东西…@catalin我想,如果我使用的是比3.0.2旧的wxwidget版本。我用的是3.0.2。我应该如何解决它?wx配置--版本3.0.2我正在使用的这个版本。简短的回答是“使用
3.1.0
”。
#include <wx-3.0/wx/propgrid/propgrid.h>