Warnings when compiling with -Wall

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
EldritchCheese
Posts: 4
Joined: Mon Dec 08, 2014 9:04 pm

Warnings when compiling with -Wall

Post by EldritchCheese »

I'm not sure if this is exactly the right area to be posting this, but it seemed the closest subforum for it. I tend to compile all my code with -Wall -pedantic -Wextra, as it is useful for finding many forms of accidental errors. However, this tends to cause a large number of warnings whenever including the irrlicht header files. None of the warnings I have looked at are causes for alarm, and are relatively easy to avoid. (e.g. unused parameters, narrowing conversions, etc.) However, these large number of spurious warnings prevent me from easily seeing warnings originating from my own code.

I have been wanting to go through and make the small changes necessary to avoid triggering the warnings. Would there be interest in a patch that aims to have user code compile without warnings, even with all warnings enabled?
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Warnings when compiling with -Wall

Post by CuteAlien »

No, we only do -Wall (which should compile headers without warnings - you probably get them from pedandic and extra). There have been some tries fixing the rest, but those fixes are often rather hard to get correct on all compilers (so we got g++ nice, but VS started complaining for example). So now we're happy when headers compile with -Wall. Also I sometimes think the other settings are mainly to make coders to feel good - I never really found a bug by enabling them...
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Warnings when compiling with -Wall

Post by hendu »

In your project, use -isystem <irrlicht path> instead of -I. That means those headers aren't checked for warnings.
EldritchCheese
Posts: 4
Joined: Mon Dec 08, 2014 9:04 pm

Re: Warnings when compiling with -Wall

Post by EldritchCheese »

Thank you for the quick responses. I tend to be a bit paranoid with my compiler flags, but I know that it isn't for everyone. I've had a few cases where -Wunused-parameter has reminded me that a function stub had never been implemented, and so I try to keep my build scripts as nit-picky as possible. I like the suggestion about -isystem, and will probably add it in to my build.
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Warnings when compiling with -Wall

Post by CuteAlien »

Yeah, nice - I didn't know about isystem.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply