Make implicit fallthroughs a compiler error, remove unneeded breaks

Authored by aaronpuchert on Oct 2 2018, 9:22 PM.

Description

Make implicit fallthroughs a compiler error, remove unneeded breaks

Summary:
With -Wimplicit-fallthrough the compiler warns about unannotated
fallthroughs in switch statements. Since it is supported by both GCC and
Clang, and can easily be fixed by adding Q_FALLTHROUGH() we enable it as
error.

As a consequence, we don't need to add redundant break statements as
safety measure. So we also warn about that, but not as error, especially
since it's only supported on Clang. (As far as I know.)

Reviewers: KDevelop, kossebau, kfunk

Reviewed By: KDevelop, kfunk

Subscribers: mwolff, apol, kfunk, rjvbb, brauch, mssola, kossebau, kdevelop-devel

Tags: KDevelop

Differential Revision: https://phabricator.kde.org/D15694

Details