Closed Bug 279210 Opened 20 years ago Closed 16 years ago

Compiler warning because of nsCOMPtr<nsIPresContext>

Categories

(Core :: XPCOM, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: aaronlev, Assigned: benjamin)

References

Details

Attachments

(1 file, 1 obsolete file)

I'm getting multiple repetitions of the following VC++ compiler warnings when
building the accessible directory:

nsHTMLInputElement.cpp
../../../../dist\include\xpcom\nsCOMPtr.h(228) : warning C4624:
'nsDerivedSafe<T>' : destructor could not be generated because a base class
destructor is inaccessible
        with
        [
            T=nsPresContext
        ]
        c:/moz\mozilla\content\html\content\src\nsHTMLInputElement.cpp(705) :
see reference to class template instantiation 'nsDerivedSafe<T>' being compiled
        with
        [
            T=nsPresContext
        ]
Actually, I'm noticing this in more places than just the accessible directory.

I believe that getting rid of the nsCOMPtr<> around nsIPresContext fixes the
problem.
I saw this kind of warning when compiling nsProxyEventClass, nsObserverEnumerator, nsCategoryManager, xptiAdditionalManagersEnumerator, nsProxyEventObject, nsEventQueueServiceImpl, nsXPCFastLoadIO, nsPACMan, nsProxyInfo, nsHostRecord, nsHostResolver, nsMappedAttributes, nsHTMLStyleSheet, nsSVGCoordCtxHolder.

Adding a non implemented destructor to nsCOMPtr seems the solution in analogy with bug 209667. I did try this patch on a custom build: warning were gone and build was fine but I'm not 100% sure this is the right solution.
QA Contact: bugzilla → disability.access
Comment on attachment 211776 [details] [diff] [review]
define a non implemented dtor for nsDeriveSafe

Asking for review.
Attachment #211776 - Flags: review?
Attachment #211776 - Flags: review?(dbaron)
Attachment #211776 - Flags: review?(benjamin)
Attachment #211776 - Flags: review?
Comment on attachment 211776 [details] [diff] [review]
define a non implemented dtor for nsDeriveSafe

This is OK with me, but I'd like Benjamin to look as well.
Attachment #211776 - Flags: review?(dbaron) → review+
Comment on attachment 211776 [details] [diff] [review]
define a non implemented dtor for nsDeriveSafe

This will break IRIX, I'm afraid.

Really, what I'd like to do is get rid of nsDerivedSafe altogether... I think it has outlived its usefulness and is now just an extra layer of C++ cruft. Dbaron, what do you think?
Attachment #332753 - Flags: review?(dbaron)
Comment on attachment 332753 [details] [diff] [review]
remove nsderivedsafe, rev. 1

OK.  I've never been crazy about nsDerivedSafe, since it requires extra casts or .get() when static_casting an nsCOMPtr to a more-derived class; we should probably file a followup bug on finding and removing those...
Attachment #332753 - Flags: review?(dbaron) → review+
Attachment #211776 - Flags: review?(benjamin)
Pushed to mozilla-central, revision 2cdac4c2a023
Assignee: aaronleventhal → benjamin
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
[Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1a2pre) Gecko/20080811184452 Minefield/3.1a2pre] (home, optim default) (W2Ksp4)

V.Fixed
Status: RESOLVED → VERIFIED
Component: Disability Access → XPCOM
Product: Firefox → Core
QA Contact: disability.access → xpcom
Version: unspecified → Trunk
Attachment #211776 - Attachment is obsolete: true
(In reply to comment #7)
> we should probably file a followup bug on finding and removing those...

I filed bug 450127...
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: