Closed Bug 1219139 Opened 4 years ago Closed 4 years ago

Fix -Wimplicit-fallthrough warnings in dom/events and widget/IMEData.h

Categories

(Core :: User events and focus handling, defect)

defect
Not set

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;
}

The fixed warnings:

widget/IMEData.h:428:7 [-Wimplicit-fallthrough] unannotated fall-through between switch labels

dom/events/EventStateManager.cpp:601:7 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
dom/events/EventStateManager.cpp:654:3 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
dom/events/EventStateManager.cpp:714:3 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
dom/events/EventStateManager.cpp:1239:3 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
dom/events/EventStateManager.cpp:3045:3 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
dom/events/EventStateManager.cpp:4173:3 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
Attachment #8679838 - Flags: review?(masayuki)
https://hg.mozilla.org/mozilla-central/rev/f4ad9da5ed94
Status: NEW → RESOLVED
Closed: 4 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
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.