Closed Bug 500202 Opened 15 years ago Closed 15 years ago

Unused variable build warnings.

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: davidb, Assigned: davidb)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Compiler complains about unused variables.
Attached patch trivial fix.Splinter Review
Attachment #384876 - Flags: review?(surkov.alexander)
Attachment #384876 - Flags: review?(marco.zehe)
Comment on attachment 384876 [details] [diff] [review]
trivial fix.

trivial indeed, r=me. Thanks!
Attachment #384876 - Flags: review?(marco.zehe) → review+
Attachment #384876 - Flags: review?(surkov.alexander)
pushed: http://hg.mozilla.org/mozilla-central/rev/113c5916881f
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
I think this requires more investigations because we shouldn't hide errors in general.
We aren't hiding errors here. The return value rv was stored in a variable, but the variable was unused in that code path. I think the compiler warning and the fix are valid.
(In reply to comment #5)
> We aren't hiding errors here. The return value rv was stored in a variable, but
> the variable was unused in that code path. I think the compiler warning and the
> fix are valid.

I mean it's wrong nsresult variable wan't used - this is what I call hiding errors.
Aha I see what you mean and I generally agree. In this case I was thinking the aName.IsEmpty check is sufficient. I suppose we could check the return value and ASSERT but is that what we want here?
I think NS_ENSURE_SUCCESS should work for us. We could use ASSERT if we're sure it won't happen. Though it's probably worth to have special case for xblAccessible->GetAccessibleName(aName) to not propagate XBL's mistakes. However if XBL's accessibleName throws Components.results.ERROR then we should use it.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: