SFML / imgui-sfml

Dear ImGui backend for use with SFML
MIT License
1.08k stars 163 forks source link

Add and fix compiler warnings #246

Closed ChrisThrasher closed 11 months ago

ChrisThrasher commented 11 months ago

Silencing the OpenGL deprecation warnings was my first goal since they were cluttering up the console output. While I was in there I added a quick a few lines to add the most basic GCC and Clang warnings. I see a few other PRs are touching on compiler warnings as well so this helps lay the groundwork to add (and fix) more warnings in the future.

I also kept another commit that fixes a little typo I found a few days ago.

oprypin commented 11 months ago

Hold up- I didn't think this through so well. This means that if in the future the compilers start spewing more warnings, people will not be able to build the project?

ChrisThrasher commented 11 months ago

This means that if in the future the compilers start spewing more warnings, people will not be able to build the project?

Theoretically yes, but in practice not likely with this basic set of warnings. Regardless it still may be a good idea to add a cache variable to disable -Werror like SFML has.

For now let's focus on adding and fixing more warnings because the #1 way to address potential compiler warnings is to aggressively find and fix them. We need to enable and fix more warnings until we approach the set of warnings that SFML uses. That will require some extra stuff to make sure we don't apply any warnings to the ImGui source code that we're compiling. Once we get there the code will be overall cleaner and less likely to cause issues when 3rd parties build it.