Merge lp:~hjd/widelands/more-warnings into lp:widelands
Status: | Merged |
---|---|
Merged at revision: | 6523 |
Proposed branch: | lp:~hjd/widelands/more-warnings |
Merge into: | lp:widelands |
Diff against target: |
144 lines (+28/-26) 6 files modified
CMakeLists.txt (+1/-1) src/editor/editorinteractive.cc (+4/-3) src/minizip/unzip.cc (+3/-0) src/scripting/pluto.cc (+2/-0) src/ui_basic/messagebox.cc (+14/-14) src/ui_fsmenu/options.cc (+4/-8) |
To merge this branch: | bzr merge lp:~hjd/widelands/more-warnings |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
SirVer | Approve | ||
Nicolai Hähnle | Approve | ||
Review via email: mp+148949@code.launchpad.net |
Description of the change
Adding another batch of additional warnings. Mainly finds a couple of issues reported by -Wswitch-enum and -Wswitch-default, as well as a couple of others which doesn't seem to hurt.
As mentioned, this includes -Wswitch-enum which has been silenced in several places, since some places will trigger warnings on 200+ SDL_* enums not used. I hope this won't ignore any important warnings, though adding 200 different elements just to have them there doesn't seem ideal either.
Some notes:
The two methods touched in src/ui_
Had to add explicit brackets to a conditional in editorinteracti
Thank you for doing this. I am a bit worried about the discussion in the linked bug reports that compilers ignore enabled warnings if the encounter some warning option that they don't know about. Isn't there some way to make this more robust, in case the supported compiler options change at some point? Of course, this may be something for a separate merge and doesn't necessarily need to be addressed here.
The explicit brackets are a good thing.
I oppose -Wswitch-enum. The appropriate way to indicate our intention in those switch(SDL_keysym) cases is by adding a default: label, and that should therefore be sufficient to stop the compiler from complaining. According to the gcc documentation, -Wswitch-enum complains even when a default: label exists, and we should therefore use -Wswitch rather than -Wswitch-enum. Note that, according to the documentation, -Wswitch is part of -Wall.
Other than that, I like your changes.