Closed Bug 964075 Opened 7 years ago Closed 7 years ago

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

Categories

(Core :: XPCOM, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: dholbert, Assigned: dholbert)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Attached 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
Attached 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: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in before you can comment on or make changes to this bug.