Page 1 of 1

About compiler warnings

Posted: Wed Mar 29, 2017 11:08 am
by REDDemon
I just tried to enable all warnings on irrlicht when compiling with VS, I thought it was a nice idea to fix compiler warnings, but the list is soo long. Didn't even tried GCC.

What is the policy of irrlicht around warnings? some kind of warnings that makes sense to fix? In example => unused parameters can be easily fixed by casting unused parameters to void. but conversions/casts are just too much to get rid off.

actually 33481 warnings with VS building the static library in trunk .

Re: About compiler warnings

Posted: Wed Mar 29, 2017 11:52 am
by CuteAlien
The reason most warnings which are still in there are because they are real warnings. Especially those case-switch stuff which complains that some formats are not supported. Only remove those if you a) add the support for that format in that place or b) Figure out a good solution to handle it when the format is not supported.
Not sure about unused parameter right now... but we don't compile with anything above /W3.
Stuff like getting rid of unused function parameters in a no-cost-cross-platform way ... uhm, not even sure if that improves anything. I get that programmers feel like we should "clean" everything - get highest compile-warning working. We tick like that. But - sometimes it's really not worth the bother because it just risks breaking some platform where you didn't test if your workaround for one compiler doesn't mess up with another one (no-one here compiles every-time for different VS compilers, GCC compilers, on Windows, Linux, OSX and Android - unless you have a compile-server doing that for you it's near impossible doing all that).

edit: Note that there is at least one _real_ warning in W3 right now with instantiation. That one should be fixed.

Re: About compiler warnings

Posted: Wed Mar 29, 2017 12:09 pm
by REDDemon
ok thanks! :) For know I'll just keep fixing warnings in code I touch and only if the fix is portable.