2016-12-21 9 views
1

Я всегда получаю это предупреждение: https://gist.githubusercontent.com/jS5t3r/ccb8a6e3db18d5133d37986b8979baef/raw/f4750f5ac3211b0560d27b035d31542877669e07/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 -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] 
+0

очень сложно что-то сказать, не видя кода. Однако это просто предупреждение, и если прогрм работает нормально, вы можете не обращать внимания. – Igor

+0

Вы должны действительно включать сообщения об ошибках в свой вопрос вместо того, чтобы полагаться на внешнюю ссылку. –

+0

@Igor Я бы не просто игнорировал предупреждения. – j35t3r

ответ

3

Это было исправлено в Optimize wxPGChoices::Set method фиксации, который был после 3.0.2. Чтобы использовать его, вам нужно получить последнюю ветку 3.0 от версии git или 3.1.0 - в принципе что-нибудь после этого совершить.

+0

wx-config --version 3.0.2 Эта версия, которую я использую. – j35t3r

+0

Короткий ответ будет «использовать« 3.1.0' ». – catalin

0

Я изменил включаемые от

#include <wx/propgrid/propgrid.h> 

в

#include <wx-3.0/wx/propgrid/propgrid.h> 

Сейчас он работает нормально.

+0

Это не похоже на правильный подход. Изменение заголовков, но не использование исходных файлов, соответствующих новым заголовкам, не совсем нормально. – catalin

+0

В дополнение к тому, что говорит предыдущий комментарий, это вообще ничего не может изменить ... –

+0

@catalin Я думаю, если я использую , я использую версию wxwidget старше 3.0.2 , С этим взломом hack я использую 3.0.2. Как я должен это решить? – j35t3r