Re-enable disabled GCC warnings where possible #7379
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR removes all
-Wno-<warning>
flags that are unnecessary, or for which the code is fixable. The only one left is-Wno-array-bounds
, which triggers false positives with sufficient optimisations enabled - see the comment in the code for more information. I added-Wno-stringop-overread
to this, which suffers from the same problems, for GCC versions 11 and above (required to build with-Werror
on my machine). I removed-Werror=unused-function
since-Wunused-function
is included in-Wall
, and I see no reason to have it be an error even without-Werror
.Most of the code changes are fixes for the reintroduced
-Wsign-compare
. I originally planned to introduce-Wextra
along with these changes, but there turned out to be enough already for their own PR. There may be one or two extraneous-Wextra
fixes in here that I didn't split out correctly, but they're still worth including. Other notable changes include an alternative to the old deprecated FluidSynth effect API (again, required to build with-Werror
on my machine), and a fix for SID hanging since #7363 (I caught this bug via a compiler warning prior to someone mentioning it on Discord, highlighting the utility of these warnings).