Closed
Bug 824883
Opened 12 years ago
Closed 12 years ago
Fix three warnings in dom/ code
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla20
People
(Reporter: n.nethercote, Assigned: n.nethercote)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
2.79 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
clang 3.2 gives three warnings in dom/:
- dom/base/nsStructuredCloneContainer.cpp:120:18 [-Wsometimes-uninitialized] variable 'hasTransferable' is used uninitialized whenever '&&' condition i
- dom/bindings/BindingUtils.cpp:1280:10 [-Wunused-private-field] private field 'mSlot' is not used
- dom/plugins/ipc/PluginInstanceChild.cpp:261:13 [-Wsometimes-uninitialized] variable 'currentResult' is used uninitialized whenever switch default is
taken
Assignee | ||
Comment 1•12 years ago
|
||
This patch fixes the warnings.
For the third one, note that this code is DEBUG-only; the patch lacks
sufficient context for this to be clear. Note also that I'm using MOZ_ASSERT
in the manner recommended by the patch in bug 820686:
> You should only use MOZ_NOT_REACHED when you care about the compiler
> optimizations it triggers. If you want to crash both debug and release
> builds when a particular line is reached, use MOZ_CRASH instead of
> MOZ_NOT_REACHED. If you want a debug-only crash, use MOZ_ASSERT(false).
I guess MOZ_ASSERT has |noreturn| annotations that NS_NOTREACHED does not, and
this is enough to fix the warning.
Attachment #695905 -
Flags: review?(bzbarsky)
Assignee | ||
Updated•12 years ago
|
Blocks: buildwarning
Comment 2•12 years ago
|
||
Comment on attachment 695905 [details] [diff] [review]
Fix three warnings in dom/ code.
Instead of MOZ_ASSERT and losing the string, please use MOZ_NOT_REACHED (which has the same noreturn annotations as MOZ_ASSERT).
r=me with that
Attachment #695905 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 3•12 years ago
|
||
> Instead of MOZ_ASSERT and losing the string, please use MOZ_NOT_REACHED
> (which has the same noreturn annotations as MOZ_ASSERT).
But that contradicts the patch I quoted...
Comment 4•12 years ago
|
||
> But that contradicts the patch I quoted
Oh, I see. I'd definitely missed that subtlety....
OK, r=me on the patch as it stands.
Assignee | ||
Comment 5•12 years ago
|
||
Summary: Fix three warnings in dom/ code. → Fix three warnings in dom/ code
Comment 6•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•