Closed Bug 1220035 Opened 10 years ago Closed 10 years ago

Fix -Wimplicit-fallthrough warnings in xpcom

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox45 --- fixed

People

(Reporter: cpeterson, Assigned: cpeterson)

References

Details

Attachments

(1 file)

Suppress clang's -Wimplicit-fallthrough warnings (not yet enabled by default in mozilla-central) about switch cases that fall through without a break or return statement. The warnings can be suppressed with the MOZ_FALLTHROUGH, a MFBT macro for a clang compiler annotation. MOZ_FALLTHROUGH is only needed on cases that have code: switch (foo) { case 1: // These cases have no code. No fallthrough annotations are needed. case 2: case 3: foo = 4; // This case has code, so a fallthrough annotation is needed: MOZ_FALLTHROUGH; default: return foo; } xpcom/base/nsDebugImpl.cpp:458:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels xpcom/ds/nsCheapSets.h:139:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels xpcom/ds/nsPersistentProperties.cpp:232:9 [-Wimplicit-fallthrough] unannotated fall-through between switch labels xpcom/ds/nsVariant.cpp:360:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels xpcom/ds/nsVariant.cpp:766:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels xpcom/ds/nsVariant.cpp:1658:9 [-Wimplicit-fallthrough] unannotated fall-through between switch labels xpcom/ds/nsVariant.cpp:1661:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels xpcom/glue/nsTextFormatter.cpp:355:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels xpcom/glue/nsTextFormatter.cpp:362:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels xpcom/io/nsWildCard.cpp:85:7 [-Wimplicit-fallthrough] unannotated fall-through between switch labels xpcom/io/nsWildCard.cpp:401:7 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
Attachment #8681065 - Flags: review?(continuation)
Attachment #8681065 - Flags: review?(continuation) → review+
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
removing the b2g 2.5 flag since this commit has been reverted due to an incorrect merge, sorry for the confusion
Blocks: 1253170
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: