Closed Bug 1108024 Opened 11 years ago Closed 11 years ago

Mark overriding functions in NS_DECL_ISUPPORTS & friends as MOZ_OVERRIDE

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla37

People

(Reporter: dholbert, Assigned: dholbert)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

clang 3.6 introduces a new warning, which warns if we *could* specify 'override' but don't. To avoid spamming this warning incessantly for folks using clang-3.6, we should add MOZ_OVERRIDE wherever possible. (and conveniently, clang 3.6 tells us where to do this) Filing this bug to add annotations in the NS_DECL_ISUPPORTS macros in nsISupportsImpl.h. This fixes warnings like the following: { $SRCDIR/dom/xslt/xpath/txNodeSetAdaptor.h:26:5: error: 'Release' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] NS_DECL_ISUPPORTS_INHERITED ^ ../../../dist/include/nsISupportsImpl.h:968:40: note: expanded from macro 'NS_DECL_ISUPPORTS_INHERITED' NS_IMETHOD_(MozExternalRefCountType) Release(void); \ ^ $SRCDIR/dom/xslt/xpath/txXPathObjectAdaptor.h:28:5: note: overridden virtual function is here NS_DECL_ISUPPORTS ^ ../../../dist/include/nsISupportsImpl.h:390:40: note: expanded from macro 'NS_DECL_ISUPPORTS' NS_IMETHOD_(MozExternalRefCountType) Release(void) MOZ_OVERRIDE; \ ^ }
(tangent: note that one of the methods in the context of this patch is left un-annotated -- DeleteCycleCollectable(). That's intentional, because that function is not declared in a superclass. It's possible that this function shouldn't be virtual; smaug says he's pretty sure it needs to be, though, because there are some superclasses/subclass pairs that both have declarations/implementations of it. Anyway, any necessary tweaks to that method can happen elsewhere.)
Attachment #8532631 - Flags: review?(nfroyd)
Attachment #8532631 - Flags: review?(nfroyd) → review+
Blocks: 1108169
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: