Fix -Wimplicit-fallthrough warning in modules/libjar/

RESOLVED FIXED in Firefox 46

Status

()

Core
Networking: JAR
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: cpeterson, Assigned: cpeterson)

Tracking

unspecified
mozilla46
Points:
---

Firefox Tracking Flags

(firefox46 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
Created attachment 8702098 [details] [diff] [review]
libjar_MOZ_FALLTHROUGH.patch

modules/libjar/nsJARInputStream.cpp:112:13 [-Wimplicit-fallthrough] unannotated fall-through between switch labels

This patch fixes a clang -Wimplicit-fallthrough warning (not yet enabled by default in mozilla-central) about switch cases that fall through without a break or return statement. Warnings about intentional fallthroughs can be suppressed with 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;
}
Attachment #8702098 - Flags: review?(aklotz)
Comment on attachment 8702098 [details] [diff] [review]
libjar_MOZ_FALLTHROUGH.patch

Review of attachment 8702098 [details] [diff] [review]:
-----------------------------------------------------------------

Cool, thanks!
Attachment #8702098 - Flags: review?(aklotz) → review+

Comment 3

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/96ce3bd0b806
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox46: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
You need to log in before you can comment on or make changes to this bug.