-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add compiler warnings while in debug mode #52
Comments
This should actually be pretty easy to do, but it depends on how much detail we really want on our warnings. I have a makefile somewhere that will spit out just about every warning ever, but I doubt we want that level of detail. I'll also look into seeing what flags are enabled by default in debug vs release. |
Alright so status update on this! If you add the following to the top level CMakeLists.txt, we get a lot of warnings.
I got that from this StackOverflow post, but I did remove -Werror for testing purposes and then also -pedantic as the pedantic warnings were also coming from GLAD and other external dependencies. I then used this command |
As for the original request, I'll look at what flags CMake's release mode uses vs their debug mode flags and see if we can get debug mode to have the same warnings. |
Apparently the issue here is that CMake disables optimizations by default for debug mode, so its harder for the compiler to tell when things are potentially uninitialized (a common cause of warnings in release mode that we don't see in debug mode). Looking at this, we could probably try enabling |
We only get a limited number of warnings when in release mode (using gcc 10). We also see many warnings when compiling with clang, so it might be a good idea to enable these in debug mode for gcc.
The text was updated successfully, but these errors were encountered: