Closed Bug 1437655 Opened 2 years ago Closed 2 years ago

nsRuleNode.cpp:2886:10: warning: 'return' will never be executed [-Wunreachable-code-return]

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Noticed this when building locally (with clang 7.0 and unified-mode mode turned off, which might be necessary for this warning to be triggered -- not sure):
====
layout/style/nsRuleNode.cpp:2886:10: warning: 'return' will never be executed [-Wunreachable-code-return]
====

This warning is for an unreachable "return nullptr" statement, which comes after a "switch" block that returns from all of its cases (including a default case).  So indeed, this line is unreachable.

This issue goes back to bug 454475, which is where we added the default case.
Comment on attachment 8950347 [details]
Bug 1437655: Remove unreachable "return" statement in nsRuleNode::SetDefaultOnRoot.

https://reviewboard.mozilla.org/r/219574/#review225368
Attachment #8950347 - Flags: review?(bwerth) → review+
Thanks for the review!
Pushed by dholbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/850a68535455
Remove unreachable "return" statement in nsRuleNode::SetDefaultOnRoot. r=bradwerth
https://hg.mozilla.org/mozilla-central/rev/850a68535455
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.