Closed Bug 1068102 Opened 10 years ago Closed 10 years ago

unused variables introduced by bug 994190: ActorsChild.h:224:19: warning: private field 'mPersistenceType' is not used [-Wunused-private-field], and two unused const variables in ActorsParent.cpp

Categories

(Core :: Storage: IndexedDB, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: dholbert, Assigned: dholbert)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 1 obsolete file)

New build warning, with clang 3.5 on Linux:
{
dom/indexedDB/ActorsChild.cpp:5:
dom/indexedDB/ActorsChild.h:224:19: warning: private field 'mPersistenceType' is not used [-Wunused-private-field]
}

Indeed, this private member-var is set but unused, as a quick skim through http://mxr.mozilla.org/mozilla-central/source/dom/indexedDB/ActorsChild.cpp shows.

bent, can this variable be removed?
Flags: needinfo?(bent.mozilla)
This warning was introduced by bug 994190. While we're at it, that bug also introduced these unused-const-variable warnings:
{
dom/indexedDB/ActorsParent.cpp:161:12: warning: unused variable 'kPermissionString' [-Wunused-const-variable]

 const char kPermissionString[] = IDB_PREFIX;
            ^

dom/indexedDB/ActorsParent.cpp:163:12: warning: unused variable 'kChromeOrigin' [-Wunused-const-variable]

 const char kChromeOrigin[] = CHROME_PREFIX;
            ^
}

Presumably those also want to be removed.
Summary: dom/indexedDB/ActorsChild.h:224:19: warning: private field 'mPersistenceType' is not used [-Wunused-private-field] → unused variables introduced by bug 994190: ActorsChild.h:224:19: warning: private field 'mPersistenceType' is not used [-Wunused-private-field], and two unused const variables in ActorsParent.cpp
The const variables are easy enough to remove, at least.

(Handling mPersistenceType separately, as I'm not sure if there's a plan to use it.)
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #8490142 - Flags: review?(bent.mozilla)
Attachment #8490142 - Attachment is obsolete: true
Attachment #8490142 - Flags: review?(bent.mozilla)
Attachment #8490143 - Flags: review?(bent.mozilla)
Here's a patch to remove the unused mPersistenceType vars, but per my XXX comment in the patch, this leaves the constructor with an unused argument. (which doesn't trigger a warning, but is still messy & worth removing)

I'm not sure what's supposed to be happening with these mPersistenceType variables; it looks like it's passed down from somewhere higher up (most directly, from the params passed to IDBFactory::InitiateRequest); should we remove them up the stack as much as possible, or should we really be reacting to them here?
Attachment #8490150 - Flags: feedback?(bent.mozilla)
Blocks: 1068113
Yeah, I removed all those variables in my local patches.
Everything works fine.
Right, removing the variables should have no effect on behavior -- that's what the compiler is telling us with these warnings.

The question, though, is: are we *supposed* to be checking these variables? (or, are we intending to start using them in some subsequent landing-soon patch?)

(If we do want to use them, then perhaps "Part 2" should be replaced with an unused<< hack, with a reference to a followup bug where we intend to add the usages.)
Attachment #8490143 - Flags: review?(bent.mozilla)
Flags: needinfo?(bent.mozilla)
Bug 994190 was backed out so this is WFM.

I'll fix this on jamun before bug 994190 is fixed.
Status: ASSIGNED → RESOLVED
Closed: 10 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: