Proper silencing for the switch-case fall-through warning
ClosedPublic

Authored by TallFurryMan on Aug 20 2018, 7:07 AM.

Details

Summary

This changeset silences the gcc warning for the case fall-through.
No idea if this will work for msvc, but that doesn't change much compared to the previous state.
C++17 can use "fallthrough;" to specify an execution path that intentionally falls through the following case.

Test Plan

Without this change, gcc issues a warning on the case fall-through in function unParkMount.
With this change fall-through is acknlowledged and the warning doesn't appear.

Diff Detail

Repository
R321 KStars
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
TallFurryMan created this revision.Aug 20 2018, 7:07 AM
Restricted Application added a project: KDE Edu. · View Herald TranscriptAug 20 2018, 7:07 AM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
TallFurryMan requested review of this revision.Aug 20 2018, 7:07 AM
broulik added a subscriber: broulik.EditedAug 20 2018, 7:46 AM

I think you want to be using Q_FALLTHROUGH which uses the proper compiler attribute if available

TallFurryMan planned changes to this revision.Aug 20 2018, 8:03 AM

Thanks, didn't know about this macro.

Changed fall-through comment for Q_FALLTHROUGH (thanks @broulik).

mutlaqja accepted this revision.Aug 20 2018, 7:25 PM
This revision is now accepted and ready to land.Aug 20 2018, 7:25 PM
This revision was automatically updated to reflect the committed changes.

Q_FALLTHROUGH() was introduced in Qt 5.8, but kstars supports Qt >= 5.4.0. Building on Raspbian Stretch (Debian 9) fails.

Oh well. I don't think having a #ifdef there will be that nice. Please revert that change.