Closed
Bug 208868
Opened 22 years ago
Closed 22 years ago
New nsCSSDataBlock.cpp produces "may be used uninitialized" warning.
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: mozilla-bugs, Assigned: dbaron)
References
()
Details
Attachments
(1 file, 2 obsolete files)
2.21 KB,
patch
|
Details | Diff | Splinter Review |
Brad Tbox shows a new "may be used uninitialized" warning:
+content/html/style/src/nsCSSDataBlock.cpp:349
+ `void*copy' might be used uninitialized in this function
The warning was introduced by the bug 125246 check-in. In comes from a
"notreached" default case in a switch statement and is trivial to fix (patch
coming up in a moment).
Assignee | ||
Comment 1•22 years ago
|
||
I'm curious to see what the "simple" fix is. I'd rather not add real code
that's never used. (I almost used gotos here instead of the inner switch.)
Assignee | ||
Comment 2•22 years ago
|
||
(I guess one could put the unreachable default case first, and without a |break;|.)
Reporter | ||
Comment 3•22 years ago
|
||
Reporter | ||
Comment 4•22 years ago
|
||
Comment on attachment 125265 [details] [diff] [review]
Initialize the variable in the "default" switch case.
Is this reasonable? Thanks!
Attachment #125265 -
Flags: review?(dbaron)
Assignee | ||
Updated•22 years ago
|
Attachment #125265 -
Flags: review?(dbaron) → review-
Comment 5•22 years ago
|
||
We shouldn't necessarily add code size and runtime cost. If gcc is failing to
do enough flow analysis to determine that the default: case is never reached,
then it might be better to hold out for a gcc fix, and live with the warning.
/be
Assignee | ||
Comment 6•22 years ago
|
||
Assignee | ||
Comment 7•22 years ago
|
||
Comment on attachment 125270 [details] [diff] [review]
since people annoy me when I produce warnings, replace with gotos
Actually, this increases code size, probably since gcc doesn't optimize it as
well...
Attachment #125270 -
Attachment is obsolete: true
Assignee | ||
Comment 8•22 years ago
|
||
Assignee | ||
Updated•22 years ago
|
Attachment #125265 -
Attachment is obsolete: true
Assignee | ||
Comment 9•22 years ago
|
||
Fix by checkin of bug 208872 to trunk, 2003-06-10 15:08 -0700.
Updated•21 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•