Closed Bug 964074 Opened 10 years ago Closed 10 years ago

clang build warning: docshell/base/nsDocShell.cpp:192:22: warning: unused variable 'kAppShellCID' [Wunused-const-variable]

Categories

(Core :: DOM: Navigation, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: dholbert, Assigned: smaug)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Clang 3.4 and 3.5 (at least) have a warning for "-Wunused-const-variable", and we're hitting some instances of it that trigger errors in --enable-warnings-as-errors builds.

One instance:
{
docshell/base/nsDocShell.cpp:192:22: error: unused variable 'kAppShellCID' [-Werror,-Wunused-const-variable]
static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
                     ^
../../dist/include/nsID.h:86:15: note: expanded from macro 'NS_DEFINE_CID'
  const nsCID _name = _cidspec
              ^
}

Just an unused static variable that can be dropped, basically.
Blocks: buildwarning
Attached patch fix v1Splinter Review
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #8365697 - Flags: review?(bugs)
Comment on attachment 8365697 [details] [diff] [review]
fix v1

(sorry; my browser initially autocompleted the patch name from "fix v1" to a longer string that I'd used for an fix somewhere else)
Attachment #8365697 - Attachment description: fix v1: make SetCompositor impls take a Compositor* and static_cast it → fix v1
MXR search demonstrating that kAppShellCID is never used in this file:
http://mxr.mozilla.org/mozilla-central/search?string=kAppShellCID&find=nsDocShell.cpp
Attachment #8365697 - Flags: review?(bugs) → review+
But please don't land this yet. I may need to backout the patch which caused this.
Blocks: 930793
OK. Setting needinfo=you, to update this bug when you're sure whether that patch will/won't be backed out.

(Thanks for the review!)
Flags: needinfo?(bugs)
It was backed out long ago, and haven't had time to fix b2g reftest framework in order to land it again.
Flags: needinfo?(bugs)
OK. I don't think there's any value in leaving this open and trying to remember that this should land after that bug (eventually) re-lands.

Would you mind just removing the unnecessary NS_DEFINE_CID line from your local version of the patch, so that this bug doesn't get re-introduced when bug 930793 lands?  Assuming that's all right with you, I'm resolving as FIXED by backout in bug 930793 comment 44. (and I'm assuming this will still be fixed when bug 930793 re-lands.)
Assignee: dholbert → nobody
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Assignee: nobody → bugs
Target Milestone: --- → mozilla29
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: