Closed Bug 188640 Opened 17 years ago Closed 17 years ago
Embed Global History .cpp: enum Write Entry If Unwritten can test NS _SUCCEEDED(rv) on an uninitialized rv!
After embedding/lite became a part of the build, a new "uninitialized" warning appeared on brad TBox: +embedding/lite/nsEmbedGlobalHistory.cpp:538 + `nsresult rv' might be used uninitialized in this function The code in question (end of enumWriteEntryIfUnwritten function) looks as follows: nsresult rv; if (!entry->GetIsWritten()) rv = writeEntry(outStm, stringKey, entry); return NS_SUCCEEDED(rv) ? PR_TRUE : PR_FALSE; Indeed, when the "if" condition is false, the function will return a random value (depending on memory contents in an uninitialized nsresult). P.S. See also bugs 59652 and 179819. Bug 59652 is the meta-bug tracking the fight against these (potentially very nasty) warnings and bug 179819 wants such warnings turned into compilation errors.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
V, the warning has disappeared from TBox
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.