Closed Bug 1087498 Opened 5 years ago Closed 5 years ago

mozilla-central/accessible/ipc/DocAccessibleParent.cpp:47:14: warning: unused variable ‘id’ [-Wunused-variable]

Categories

(Core :: Disability Access APIs, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: dholbert, Assigned: tbsaunde)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Build warning in opt builds:
{
mozilla-central/accessible/ipc/DocAccessibleParent.cpp:47:14: warning: unused variable ‘id’ [-Wunused-variable]
}

This is from this variable:
> 46   for (uint32_t i = 0; i < consumed; i++) {
> 47     uint64_t id = aData.NewTree()[i].ID();
> 48     MOZ_ASSERT(mAccessibles.GetEntry(id));
> 49   }

As shown here, 'id' is indeed unused in opt builds.
Is this whole loop even useful in opt builds? (Does line 47 actually do anything, on its own?)
If yes, we should use DebugOnly for 'id'.
If no, then perhaps this whole loop should just be wrapped in #ifdef DEBUG.

(I tend to think the latter option -- #ifdef DEBUG -- is what we want.)
Flags: needinfo?(tbsaunde+mozbugs)
(In reply to Daniel Holbert [:dholbert] from comment #1)
> Is this whole loop even useful in opt builds? (Does line 47 actually do
> anything, on its own?)
> If yes, we should use DebugOnly for 'id'.
> If no, then perhaps this whole loop should just be wrapped in #ifdef DEBUG.
> 
> (I tend to think the latter option -- #ifdef DEBUG -- is what we want.)

yeah, I'll ifdef that loop out.
Flags: needinfo?(tbsaunde+mozbugs)
Attachment #8509699 - Flags: review?(dbolter)
Attachment #8509699 - Flags: review?(dbolter) → review+
Thanks for catching this Daniel.
Assignee: nobody → tbsaunde+mozbugs
[needinfo=tbsaunde to make sure this gets landed]
Flags: needinfo?(tbsaunde+mozbugs)
https://hg.mozilla.org/mozilla-central/rev/b7aa4fec51e5
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Flags: needinfo?(tbsaunde+mozbugs)
Flags: qe-verify-
You need to log in before you can comment on or make changes to this bug.