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

RESOLVED FIXED in Firefox 45

Status

()

Core
Event Handling
RESOLVED FIXED
3 years ago
2 years ago

People

(Reporter: cpeterson, Assigned: cpeterson)

Tracking

unspecified
mozilla45
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox45 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
Created attachment 8679838 [details] [diff] [review]
Wimplicit-fallthrough_dom-events.patch

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)
Attachment #8679838 - Flags: review?(masayuki) → review+

Comment 2

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/f4ad9da5ed94
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox45: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45

Comment 3

3 years ago
bugherderuplift
https://hg.mozilla.org/releases/mozilla-b2g44_v2_5/rev/f4ad9da5ed94
status-b2g-v2.5: --- → fixed
removing the b2g 2.5 flag since this commit has been reverted due to an incorrect merge, sorry for the confusion
status-b2g-v2.5: fixed → ---
(Assignee)

Updated

2 years ago
Blocks: 1253170
You need to log in before you can comment on or make changes to this bug.