Get rid of compiler warnings (paying technical debt)
Under Linux+OS X we don't have any compilation warnings. But the reason for that is simply because I chose the compilation flags in a way that suppresses these warnings. However, some of these warnings would be very useful. This can be seen on Windows: compilation there generates thousands of warnings.
Not having these useful warnings enabled is bothering me: every bug the compiler can find is a bug I don't have to track down in a simulation run.
The obvious problem with enabling more warnings is, that they will just be ignored as it will be too overwhelming seeing so many of those. I would suggest the following strategy:
- We should come up with a number of warnings we want to enable in gcc/clang/vsc
- Each Apple/Snowflake developer takes one or two of these flags, enables it on their fork and fixes all occurrences. I would not be surprised, if this would unearth a few bugs.
- Enable all these warnings by default and compile with
-Werror - Celebrate the fact that we will have a cleaner code-base and that the compiler will find more bugs for us.
@AlvinMooreSr, @mpilman, and I discussed this recently and have a plan for moving forward on this issue.
The plan is to compile without -Werror by default so that we limit the scope of enabling compiler warnings. CI will enforce that PRs compile successfully with -Werror in the official docker container.
Adding more environments where we're committed to compiling with -Werror will be a longer term goal.
Also, this issue needs an assignee. I'm happy to own it.
-Wmaybe-uninitialized looks like a good candidate for the next warning to enable
This does not have clear criteria for being closed by 6.3, so I'm un-milestoning it.