Closed
Bug 1220544
Opened 9 years ago
Closed 9 years ago
Fix -Wunreachable-code warnings in xpcom
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla45
Tracking | Status | |
---|---|---|
firefox45 | --- | fixed |
People
(Reporter: cpeterson, Assigned: cpeterson)
References
Details
Attachments
(1 file)
2.42 KB,
patch
|
mccr8
:
review+
|
Details | Diff | Splinter Review |
xpcom/glue/PLDHashTable.cpp:471:10 [-Wunreachable-code-return] 'return' will never be executed xpcom/tests/TestAutoPtr.cpp:324:9 [-Wunreachable-code] code will never be executed xpcom/tests/TestBlockingProcess.cpp:6:11 [-Wunreachable-code-return] 'return' will never be executed Adding extra parens around the always-false conditional in TestAutoPtr.cpp suppresses the -Wunreachable-code warning about the printf never being reached.
Attachment #8681796 -
Flags: review?(continuation)
Comment 1•9 years ago
|
||
Comment on attachment 8681796 [details] [diff] [review] Wunreachable-code_xpcom.patch Review of attachment 8681796 [details] [diff] [review]: ----------------------------------------------------------------- Thanks for fixing this. ::: xpcom/glue/PLDHashTable.cpp @@ -467,5 @@ > } > } > - > - // NOTREACHED > - return nullptr; Please leave the comment. ::: xpcom/tests/TestAutoPtr.cpp @@ +318,5 @@ > } > > printf("\nTesting casts and equality tests.\n"); > > + if (((void*)(TestObject*)0x1000 == Please add a comment here about why you are adding these extra parens. ::: xpcom/tests/TestBlockingProcess.cpp @@ -3,4 @@ > int main() > { > while(1) PR_Sleep(PR_SecondsToInterval(10)); > - return 0; Hopefully this won't cause a warning with some less-smart compiler!
Attachment #8681796 -
Flags: review?(continuation) → review+
Assignee | ||
Comment 2•9 years ago
|
||
Thanks! I will make these changes before landing.
Comment 4•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9d35ff5cf796
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Comment 5•9 years ago
|
||
bugherder uplift |
https://hg.mozilla.org/releases/mozilla-b2g44_v2_5/rev/9d35ff5cf796
status-b2g-v2.5:
--- → fixed
Comment 6•9 years ago
|
||
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•8 years ago
|
Blocks: Wunreachable-code
You need to log in
before you can comment on or make changes to this bug.
Description
•