summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/compileroptionsbuilder.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2017-07-14 13:44:33 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2017-07-17 07:51:23 +0000
commitbe2b3c91ae4ddb97c35237da11b350c99cc6fd3b (patch)
tree30e177b9f5a019b639966a13834c2d7fd2196594 /src/plugins/cpptools/compileroptionsbuilder.cpp
parentc9301e80bb960ba5df93fdd22932257542693154 (diff)
downloadqt-creator-be2b3c91ae4ddb97c35237da11b350c99cc6fd3b.tar.gz
Add Q_FALLTHROUGH for Qt < 5.8
... and make use of it. With gcc 7, the new option -Wimplicit-fallthrough is introduced and added to the -Wextra set, triggering dozens of warnings in our sources. Therefore, we annotate all obviously intended fall-throughs. The ones that are still left are unclear and need to be checked by the respective maintainer. Change-Id: I44ead33cd42a4b41c28ee5fcb5a31db272710bbc Reviewed-by: Nikita Baryshnikov <nib952051@gmail.com> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/cpptools/compileroptionsbuilder.cpp')
-rw-r--r--src/plugins/cpptools/compileroptionsbuilder.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/plugins/cpptools/compileroptionsbuilder.cpp b/src/plugins/cpptools/compileroptionsbuilder.cpp
index 8f5fd397fb..170279c9b8 100644
--- a/src/plugins/cpptools/compileroptionsbuilder.cpp
+++ b/src/plugins/cpptools/compileroptionsbuilder.cpp
@@ -26,6 +26,7 @@
#include "compileroptionsbuilder.h"
#include <projectexplorer/projectexplorerconstants.h>
+#include <utils/qtcfallthrough.h>
#include <QDir>
#include <QRegularExpression>
@@ -201,7 +202,8 @@ static QStringList createLanguageOptionGcc(ProjectFile::Kind fileKind, bool objc
if (!objcExt) {
opts += QLatin1String("c++-header");
break;
- } // else: fall-through!
+ }
+ Q_FALLTHROUGH();
case ProjectFile::ObjCHeader:
case ProjectFile::ObjCXXHeader:
opts += QLatin1String("objective-c++-header");
@@ -211,7 +213,8 @@ static QStringList createLanguageOptionGcc(ProjectFile::Kind fileKind, bool objc
if (!objcExt) {
opts += QLatin1String("c");
break;
- } // else: fall-through!
+ }
+ Q_FALLTHROUGH();
case ProjectFile::ObjCSource:
opts += QLatin1String("objective-c");
break;
@@ -220,7 +223,8 @@ static QStringList createLanguageOptionGcc(ProjectFile::Kind fileKind, bool objc
if (!objcExt) {
opts += QLatin1String("c++");
break;
- } // else: fall-through!
+ }
+ Q_FALLTHROUGH();
case ProjectFile::ObjCXXSource:
opts += QLatin1String("objective-c++");
break;