Closed Bug 717010 Opened 13 years ago Closed 12 years ago

nsHTMLDocument.cpp:1749:12: warning: variable ‘rv’ set but not used [-Wunused-but-set-variable]

Categories

(Core :: DOM: Core & HTML, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: dholbert, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Bug 716338 turned on warnings-as-errors in content/html/content/src/Makefile.in

This breaks my local build (with --enable-warnings-as-errors), due to this build warning:
{
  nsHTMLDocument.cpp:1749:12: warning: variable ‘rv’ set but not used [-Wunused-but-set-variable]
}
Conveniently, the set-but-not-used value is just:
> 1749   nsresult rv = NS_OK;

So we can basically just drop that line. Patch coming up.
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
(In reply to Daniel Holbert [:dholbert] from comment #0)
> This breaks my local build (with --enable-warnings-as-errors), due to this
> build warning:

Sorry -- I misread my build output.  This particular warning doesn't break my build, because it's in html/document and FAIL_ON_WARNINGS has only been added in html/content thus far.

Still, worth fixing.
Component: DOM → DOM: Core & HTML
Comment on attachment 587450 [details] [diff] [review]
partial fix: move |rv| down to where it's set. (It still never gets read, though...)

Hmm, nevermind -- |rv| is still unused even after we capture mParser->Parse()'s return value, so with this patch, GCC just warns about the new lower-down line where |nsresult rv| is unused.

Not sure whether we should be caring about mParser->Parse()'s result. (We're saving it but ignoring it, right now...)
Attachment #587450 - Flags: review?(bugs)
Assignee: dholbert → nobody
Status: ASSIGNED → NEW
Attachment #587450 - Attachment description: fix → partial fix: move |rv| down to where it's set. (It still never gets read, though...)
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: