The former ensures that switch statements are adapted when an
enumeration is changed. The latter encourages to remove the default
label in fully covered switch statements, making the former more
effective. (It is silenced by default labels.)
Details
- Reviewers
mwolff - Group Reviewers
KDevelop - Commits
- R32:2162de4b755b: Add -Werror=switch and -Wcovered-switch-default
Diff Detail
- Repository
- R32 KDevelop
- Branch
- switch-enum
- Lint
No Linters Available - Unit
No Unit Test Coverage
There are no issues with -Wswitch, but some with -Wcovered-switch-default.
Sometimes people cast integers to enumeration types without checking whether it's a valid enumeration value first. So it might not be easy so safely fix all issues that arise. But I'll see what I can do.
just to make this clear: are there any remaining new compiler warnings? if so, fix them first. otherwise lgtm
@mwolff Are the additional changes Ok? There are no new warnings anymore.
I used Q_UNREACHABLE() when the enumeration was used safely and a fallback when unchecked static_casts were involved. In an ideal world, I would probably try to make sure that enumerations only ever have valid values, but right now I don't understand enough of the code base to properly fix this.
plugins/debuggercommon/mi/micommand.cpp | ||
---|---|---|
259 | I'm not sure this is intentional, but I'm going to leave it for now. I promised no functional change. |