Closed
Bug 805552
Opened 13 years ago
Closed 13 years ago
g++ 4.7 opt builds w/ --enable-warnings-as-errors hit tons of error: variable ‘rv’ set but not used [-Werror=unused-but-set-variable] in /netwerk
Categories
(Core :: Networking, defect)
Tracking
()
RESOLVED
FIXED
mozilla19
People
(Reporter: dholbert, Assigned: dholbert)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
14.17 KB,
patch
|
jduell.mcbugs
:
review+
|
Details | Diff | Splinter Review |
Just tried to do an opt build w/ --enable-warnings-as-errors, and I hit a bunch of errors in /netwerk from nsresults whose values are set but not used (only checked in debug builds).
These need to be labeled as DebugOnly. Filing this bug on fixing 'em.
Assignee | ||
Comment 1•13 years ago
|
||
Attachment #675233 -
Flags: review?(jduell.mcbugs)
Comment 2•13 years ago
|
||
Comment on attachment 675233 [details] [diff] [review]
fix v1
Review of attachment 675233 [details] [diff] [review]:
-----------------------------------------------------------------
::: netwerk/base/src/nsIOService.cpp
@@ -691,5 @@
> }
> }
>
> nsIIOService *subject = static_cast<nsIIOService *>(this);
> - nsresult rv;
any reason not to just make keep this as a DebugOnly rv, instead of declaring 3 separate vars in different subscopes? Not a big deal--either works.
Attachment #675233 -
Flags: review?(jduell.mcbugs) → review+
Assignee | ||
Comment 3•13 years ago
|
||
Just for scoping purposes.
In each usage of "rv" in that function, the variable is set & then immediately checked, inside of a restricted "{...}" block, and that value is never used again. So, no need to let the value leak outside of that scope. (Plus, there's no perf impact to redeclaring it, since it's DebugOnly anyway.)
Assignee | ||
Comment 4•13 years ago
|
||
Thanks for the quick review turnaround! Landed:
https://hg.mozilla.org/integration/mozilla-inbound/rev/3dc8241751a9
Comment 5•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
You need to log in
before you can comment on or make changes to this bug.
Description
•