From c26994ff1551aa5450383cc51bed9b4d39f973f7 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Thu, 29 Feb 2024 09:30:24 +0800 Subject: Fix -Wimplicit-fallthrough for clang Clang's `-Wimplicit-fallthrough` warnings are a little stricter than gcc's interpretation: switch (i) { case 0: foo(); case 4: break; } While gcc accepts the implicit fallthrough, if the following statement is a trivial `break`, clang will warn about it. Pick-to: 6.7 Change-Id: I38e0817f1bc034fbb552aeac21de1516edcbcbb0 Reviewed-by: Volker Hilsheimer --- src/corelib/text/qunicodetools.cpp | 1 + src/corelib/time/qdatetimeparser.cpp | 1 + 2 files changed, 2 insertions(+) (limited to 'src/corelib') diff --git a/src/corelib/text/qunicodetools.cpp b/src/corelib/text/qunicodetools.cpp index f381923854..2917804830 100644 --- a/src/corelib/text/qunicodetools.cpp +++ b/src/corelib/text/qunicodetools.cpp @@ -1414,6 +1414,7 @@ static qsizetype indic_nextSyllableBoundary(QChar::Script script, const char16_t // ### needs proper testing for correct two/three part matras break; } + Q_FALLTHROUGH(); case IndependentVowel: case Invalid: case Other: diff --git a/src/corelib/time/qdatetimeparser.cpp b/src/corelib/time/qdatetimeparser.cpp index 932090a88d..ce45fff1d1 100644 --- a/src/corelib/time/qdatetimeparser.cpp +++ b/src/corelib/time/qdatetimeparser.cpp @@ -709,6 +709,7 @@ int QDateTimeParser::sectionMaxSize(Section s, int count) const case DaySectionMask: qWarning("QDateTimeParser::sectionMaxSize: Invalid section %s", SectionNode::name(s).toLatin1().constData()); + break; case NoSectionIndex: case FirstSectionIndex: -- cgit v1.2.3