Closed
Bug 31553
Opened 25 years ago
Closed 25 years ago
Build warning looking serious (uninitialized variable used)
Categories
(Core :: Layout: Form Controls, defect, P3)
Core
Layout: Form Controls
Tracking
()
VERIFIED
FIXED
M15
People
(Reporter: bratell, Assigned: pollmann)
References
()
Details
(Whiteboard: fix in hand)
During build I get a warning:
j:\mozilla\mozilla\layout\html\content\src\nsHTMLSelectElement.cpp(492) :
warning C4700: local variable 'result' used without having been initialized
which sounds bad.
http://lxr.mozilla.org/seamonkey/source/layout/html/content/src/nsHTMLSelectElem
ent.cpp#492
PRUint32 curlen;
489 nsresult result;
490 GetLength(&curlen);
491 if (curlen && (curlen > aLength)) { // Remove extra options
492 for (PRInt32 i = (curlen - 1); (i>=(PRInt32)aLength) &&
NS_SUCCEEDED(result); i--) {
493 result = Remove(i);
494 }
495 } else { // Add options?
496 }
Comment 1•25 years ago
|
||
Eric, you are "blamed" for this code, so if you could take a look. The var
"result" isn't initialized
Assignee: rods → pollmann
Assignee | ||
Comment 2•25 years ago
|
||
Oh my... Of course, this was suppsed to be "result = GetLength(&curlen);"
I'll check in the fix as soon as the tree opens to general checkins.
Status: NEW → ASSIGNED
Whiteboard: fix in hand
Target Milestone: M15
Assignee | ||
Comment 3•25 years ago
|
||
jim_nance@yahoo.com beat me to the one-liner fix. Closing this one out:
http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=mozilla/layout/html/content/src&command=DIFF_FRAMESET&file=nsHTMLSelectElement.cpp&rev1=1.71&rev2=1.72&root=/cvsroot
Notice that the line is "nsresult result=NS_OK" now, which fixes this bug.
Thanks!
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•