• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
passing NULL to non-pointer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

passing NULL to non-pointer


  • Subject: passing NULL to non-pointer
  • From: Steve Mills <email@hidden>
  • Date: Mon, 12 Dec 2005 17:29:21 -0600

(Doh! I forgot a subject when I posted this before. Sorry.)

Not sure if this is a bug or part of the spec. Template class
CPureRefCountPtr has this method:

	CPureRefCountPtr<T>& operator=(T *pObject)


Subclass CAutoPlatformBitmap inherits from CPureRefCountPtr and has this ctor:

	CAutoPlatformBitmap(bool bCreate = true);

When calling:

	CAutoPlatformBitmap		bm;

	bm = NULL;


Xcode warns:

	warning: passing NULL to non-pointer argument 1 of
'PortLib::CAutoPlatformBitmap::CAutoPlatformBitmap(bool)'


CodeWarrior knows that the calling code means to use the operator= (T*) in the base class. Which is correct?

Steve Mills
Drummer, Mac geek
http://sjmills5.home.mchsi.com/


Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: library path in framework product
  • Next by Date: Getting args for methods called in other frameworks (Appkit)
  • Previous by thread: Carbon shared libs in MachoPAckage.app ?
  • Next by thread: Getting args for methods called in other frameworks (Appkit)
  • Index(es):
    • Date
    • Thread