D15694: Make implicit fallthroughs a compiler error, remove unneeded breaks

Aaron Puchert noreply at phabricator.kde.org
Sat Sep 22 17:50:01 BST 2018


aaronpuchert created this revision.
aaronpuchert added a reviewer: KDevelop.
Herald added a project: KDevelop.
aaronpuchert requested review of this revision.

REVISION 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.)
  
  Some of the fallthroughs are suspicious to me, maybe there is actually
  an error.

REPOSITORY
  R32 KDevelop

BRANCH
  cleanup-switch-statements

REVISION DETAIL
  https://phabricator.kde.org/D15694

AFFECTED FILES
  CMakeLists.txt
  kdevplatform/language/codecompletion/normaldeclarationcompletionitem.cpp
  kdevplatform/language/duchain/navigation/abstractnavigationcontext.cpp
  kdevplatform/language/duchain/stringhelpers.cpp
  kdevplatform/outputview/outputmodel.cpp
  kdevplatform/project/projectbuildsetmodel.cpp
  kdevplatform/shell/sessionlock.cpp
  kdevplatform/vcs/vcsrevision.cpp
  plugins/clang/duchain/clangdiagnosticevaluator.cpp
  plugins/clang/duchain/clangproblem.cpp
  plugins/custom-definesandincludes/kcm_widget/projectpathsmodel.cpp
  plugins/ghprovider/ghproviderwidget.cpp
  plugins/makebuilder/makejob.cpp
  plugins/perforce/perforceplugin.cpp
  plugins/qmljs/codecompletion/context.cpp

To: aaronpuchert, #kdevelop
Cc: kdevelop-devel, glebaccon, antismap, iodelay, vbspam, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20180922/8b102311/attachment-0001.html>


More information about the KDevelop-devel mailing list