Closed Bug 964073 Opened 6 years ago Closed 6 years ago

clang build warning: widget/gtk/nsWidgetFactory.cpp:61:22: warning: unused variable 'kNativeFilePickerCID' [-Wunused-const-variable]

Categories

(Core :: Widget: Gtk, defect)

All
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: dholbert, Assigned: dholbert)

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:
{
widget/gtk/nsWidgetFactory.cpp:61:22: error: unused variable 'kNativeFilePickerCID' [-Werror,-Wunused-const-variable]
 static NS_DEFINE_CID(kNativeFilePickerCID, NS_FILEPICKER_CID);
                      ^
 ../../dist/include/nsID.h:86:15: note: expanded from macro 'NS_DEFINE_CID'
   const nsCID _name = _cidspec
               ^
}
Summary: clang build warning: widget/gtk/nsWidgetFactory.cpp:61:22: error: unused variable 'kNativeFilePickerCID' [-Wunused-const-variable] → clang build warning: widget/gtk/nsWidgetFactory.cpp:61:22: warning: unused variable 'kNativeFilePickerCID' [-Wunused-const-variable]
Attached patch fix v1Splinter Review
MXR search showing that this variable is indeed unused:
 http://mxr.mozilla.org/mozilla-central/search?string=kNativeFilePickerCID

This patch drops the decl.
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #8365694 - Flags: review?(karlt)
(As for the other token in this line -- NS_FILEPICKER_CID -- note that we still have this, towards the end of the file:
> NS_DEFINE_NAMED_CID(NS_FILEPICKER_CID);
http://mxr.mozilla.org/mozilla-central/source/widget/gtk/nsWidgetFactory.cpp#219
...which is all that we have regarding that token in any other platform-specific nsWidgetFactory.cpp file:
 http://mxr.mozilla.org/mozilla-central/ident?i=NS_FILEPICKER_CID

I don't know what good that does us, but I'm pointing it out to show that this patch isn't bringing us out of consistency with other files, in terms of how that token is used.)
Attachment #8365694 - Flags: review?(karlt) → review+
https://hg.mozilla.org/mozilla-central/rev/392019e712d7
Status: ASSIGNED → 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.