clang build warning: xpcom/components/nsComponentManager.cpp:99:12: warning: unused variable 'classIDKeyName' [-Wunused-const-variable], and many more

RESOLVED FIXED in mozilla29

Status

()

defect
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: dholbert, Assigned: dholbert)

Tracking

(Blocks 1 bug)

Trunk
mozilla29
x86_64
Linux
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

Posted file warnings list
Clang 3.4 and 3.5 (at least) have a warning for "-Wunused-const-variable". (Apparently earlier compilers don't warn about unused variables if they're const, or something, but clang now does.)

We hit a bunch of instances of this in nsComponentManager.cpp, starting with:
{
 0:28.44 Warning: -Wunused-const-variable in /mozilla-central/xpcom/components/nsComponentManager.cpp: unused variable 'classIDKeyName'
 0:28.44 /mozilla-central/xpcom/components/nsComponentManager.cpp:99:12: warning: unused variable 'classIDKeyName' [-Wunused-const-variable]
 0:28.44 const char classIDKeyName[]="classID";
 0:28.44            ^
}

I'm attaching a text file with the rest, since the lines are all a bit long and they would look ugly in a bugzilla comment.
Note: it looks like ehsan fixed some of these back in
 http://hg.mozilla.org/mozilla-central/rev/a73ffb0d0c97#l26.1
but hit build bustage and backed out in
 http://hg.mozilla.org/mozilla-central/rev/64e2f1061cde
Summary: clang build warning: xpcom/components/nsComponentManager.cpp:99:12: warning: unused variable 'classIDKeyName' [-Wunused-const-variable] → clang build warning: xpcom/components/nsComponentManager.cpp:99:12: warning: unused variable 'classIDKeyName' [-Wunused-const-variable], and many more
Assignee: nobody → dholbert
Posted patch fix v1Splinter Review
Attachment #8365701 - Flags: review?(benjamin)
Green try run: https://tbpl.mozilla.org/?tree=Try&rev=fe152d3d112c (aside from one unrelated 'make check' test-failure)
Blocks: 964077
Comment on attachment 8365701 [details] [diff] [review]
fix v1

Review of attachment 8365701 [details] [diff] [review]:
-----------------------------------------------------------------

Stealing review.  Getting rid of unused things is uncontroversial.
Attachment #8365701 - Flags: review?(benjamin) → review+
https://hg.mozilla.org/mozilla-central/rev/849b1268eb86
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in before you can comment on or make changes to this bug.