Closed
Bug 727970
Opened 13 years ago
Closed 13 years ago
TestProtocols.cpp:774:14: warning: variable ‘rv’ set but not used [-Wunused-but-set-variable]
Categories
(Core :: Networking, defect)
Core
Networking
Tracking
()
RESOLVED
FIXED
mozilla13
People
(Reporter: dholbert, Assigned: dholbert)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 obsolete file)
2.18 KB,
patch
|
jduell.mcbugs
:
review+
|
Details | Diff | Splinter Review |
Filing bug on this build warning:
{
TestProtocols.cpp: In function ‘nsresult TestProtocols::LoadURLsFromFile(char*)’:
TestProtocols.cpp:774:14: warning: variable ‘rv’ set but not used [-Wunused-but-set-variable]
}
The only places this variable is touched are here:
> 772 nsresult LoadURLsFromFile(char *aFileName)
> 773 {
> 774 nsresult rv = NS_OK;
and here:
> 799 rv = StartLoadingURL(urlString.get());
http://mxr.mozilla.org/mozilla-central/source/netwerk/test/TestProtocols.cpp#772
Assignee | ||
Comment 1•13 years ago
|
||
This patch just makes us bail out if StartLoadingURL fails.
(We've got an opened file, so we have to close it first, though.)
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #597969 -
Flags: review?(jduell.mcbugs)
Assignee | ||
Comment 2•13 years ago
|
||
same patch, just added more lines of context (so you can see where the file handle "fd" is normally opened / closed)
Attachment #597969 -
Attachment is obsolete: true
Attachment #597970 -
Flags: review?(jduell.mcbugs)
Attachment #597969 -
Flags: review?(jduell.mcbugs)
Comment 3•13 years ago
|
||
Comment on attachment 597970 [details] [diff] [review]
fix v1 w/ more context
Review of attachment 597970 [details] [diff] [review]:
-----------------------------------------------------------------
::: netwerk/test/TestProtocols.cpp
@@ +801,5 @@
> + // No need to log an error -- StartLoadingURL already
> + // did that for us, probably.
> + PR_Close(fd);
> + return rv;
> + }
A valiant attempt to add error checking to a fairly useless test program :)
None of the other calls to StartLoadingURL check for errors, and the program generally doesn't seem to do much error detection (ex. the caller of LoadURLsFromFile doesn't look at return val). But there's no point soaking developer time into fixing all that right now, as this program isn't run (only built) by buildbots anyway. So this is fine.
Attachment #597970 -
Flags: review?(jduell.mcbugs) → review+
Assignee | ||
Comment 4•13 years ago
|
||
(In reply to Jason Duell (:jduell) from comment #3)
> A valiant attempt to add error checking to a fairly useless test program :)
\o/
> None of the other calls to StartLoadingURL check for errors
Oh, true -- I thought I'd found one that did, but you're right.
> But there's no point soaking developer time into fixing all that right now
> [...] So this is fine.
cool, thanks. :)
Assignee | ||
Updated•13 years ago
|
Blocks: buildwarning
Comment 5•13 years ago
|
||
Assignee | ||
Updated•13 years ago
|
Target Milestone: --- → mozilla13
Comment 6•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•