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?
Warnings when compiling with -Wall
Re: Warnings when compiling with -Wall
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Warnings when compiling with -Wall
In your project, use -isystem <irrlicht path> instead of -I. That means those headers aren't checked for warnings.
-
- Posts: 4
- Joined: Mon Dec 08, 2014 9:04 pm
Re: Warnings when compiling with -Wall
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.
Re: Warnings when compiling with -Wall
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm