Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Kip
Experienced Solver
Posts: 61 Joined: Fri Jan 26, 2007 11:11 pm
Post
by Kip » Fri Jan 26, 2007 11:15 pm
So whenever I try to build my project, it compiles successfully, but I always get warnings issued that appear unrelated to my code, but within the wxWidgets headers themselves.
I am using wxWidgets 2.8.0 under Ubuntu Linux with gcc (GCC) 4.1.2 20070106 (prerelease) (Ubuntu 4.1.1-21ubuntu7).
I know they are probably harmless, but I would like to get rid of them if possible.
Code: Select all
kip@kip-laptop:~/Projects/Slither/trunk$ make
if g++ -DHAVE_CONFIG_H -I. -I. -I./src -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -D__WXGTK__ -Wall -g -O2 -MT SlitherApp.o -MD -MP -MF ".deps/SlitherApp.Tpo" -c -o SlitherApp.o `test -f 'src/SlitherApp.cpp' || echo './'`src/SlitherApp.cpp; \
then mv -f ".deps/SlitherApp.Tpo" ".deps/SlitherApp.Po"; else rm -f ".deps/SlitherApp.Tpo"; exit 1; fi
/usr/include/wx-2.8/wx/hashmap.h: In member function ‘wxLongToLongHashMap_wxImplementation_HashTable::Node** wxLongToLongHashMap_wxImplementation_HashTable::GetNodePtr(const long int&) const’:
/usr/include/wx-2.8/wx/hashmap.h:714: warning: dereferencing type-punned pointer will break strict-aliasing rules
/usr/include/wx-2.8/wx/clntdata.h: In member function ‘wxShadowObjectMethods_wxImplementation_HashTable::Node** wxShadowObjectMethods_wxImplementation_HashTable::GetNodePtr(const wxString&) const’:
/usr/include/wx-2.8/wx/clntdata.h:20: warning: dereferencing type-punned pointer will break strict-aliasing rules
/usr/include/wx-2.8/wx/clntdata.h: In member function ‘wxShadowObjectFields_wxImplementation_HashTable::Node** wxShadowObjectFields_wxImplementation_HashTable::GetNodePtr(const wxString&) const’:
/usr/include/wx-2.8/wx/clntdata.h:25: warning: dereferencing type-punned pointer will break strict-aliasing rules
/usr/include/wx-2.8/wx/gdicmn.h: In member function ‘wxStringToColourHashMap_wxImplementation_HashTable::Node** wxStringToColourHashMap_wxImplementation_HashTable::GetNodePtr(const wxString&) const’:
/usr/include/wx-2.8/wx/gdicmn.h:540: warning: dereferencing type-punned pointer will break strict-aliasing rules
/usr/include/wx-2.8/wx/image.h: In member function ‘wxImageHistogramBase_wxImplementation_HashTable::Node** wxImageHistogramBase_wxImplementation_HashTable::GetNodePtr(const long unsigned int&) const’:
/usr/include/wx-2.8/wx/image.h:136: warning: dereferencing type-punned pointer will break strict-aliasing rules
Kip
manianis
Experienced Solver
Posts: 72 Joined: Mon Jan 15, 2007 11:00 am
Post
by manianis » Sat Jan 27, 2007 11:06 pm
-Wall : means display all warnings try removing it and recompile your code.
Kip
Experienced Solver
Posts: 61 Joined: Fri Jan 26, 2007 11:11 pm
Post
by Kip » Sun Jan 28, 2007 12:06 am
While we predicted that would solve the problem, sometimes the warnings are useful for user code, like mine where I neglect to give attention to something in need.
I would very much like to fix the headers, if that is where the problem is, so I resume using -Wall.
Any other suggestions?
--
Kip
Auria
Site Admin
Posts: 6695 Joined: Thu Sep 28, 2006 12:23 am
Contact:
Post
by Auria » Sun Jan 28, 2007 12:12 am
On mac GCC, you can use -Wmost instead of -Wall - it will display warnings but discard those that just seem to be uselessly nitpicking
however i don't know if this option is part of GCC or just in apple's version
Kip
Experienced Solver
Posts: 61 Joined: Fri Jan 26, 2007 11:11 pm
Post
by Kip » Sun Jan 28, 2007 12:23 am
Sadly it doesn't work under Linux.
Kip
killerbot
Experienced Solver
Posts: 75 Joined: Wed Dec 26, 2007 1:13 pm
Post
by killerbot » Wed Dec 26, 2007 1:50 pm
a lot of warnings have been fixed in wx287, however the type-punned one is still there, any time frame when this will be fixed, it really polutes a build log.
Hitnrun
Knows some wx things
Posts: 27 Joined: Thu Sep 06, 2007 10:34 pm
Post
by Hitnrun » Fri Feb 08, 2008 9:22 am
Add
-fno-strict-aliasing
to your gcc compile flags.
hou
Knows some wx things
Posts: 34 Joined: Wed Apr 16, 2008 3:14 am
Post
by hou » Tue Jul 08, 2008 6:16 am
I didn't find the gcc compiler flag "wmost "in "Setting->compiler and debug->compiler flags", how do you fix the ugly warning? Thanks.
My brother is going to go to university.
killerbot
Experienced Solver
Posts: 75 Joined: Wed Dec 26, 2007 1:13 pm
Post
by killerbot » Tue Jul 08, 2008 6:57 pm
hou wrote: I didn't find the gcc compiler flag "wmost "in "Setting->compiler and debug->compiler flags", how do you fix the ugly warning? Thanks.
I guess you are talking about Code::Blocks; you can add extra gcc settings that are not in the list of compiler flags in the other options tab
hou
Knows some wx things
Posts: 34 Joined: Wed Apr 16, 2008 3:14 am
Post
by hou » Wed Jul 09, 2008 1:11 am
Can you tell me why it happen and what's the warning's meaning?
My brother is going to go to university.