• 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
Warning with offsetof macro?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Warning with offsetof macro?


  • Subject: Warning with offsetof macro?
  • From: "Mark Wagner" <email@hidden>
  • Date: Wed, 14 Jun 2006 12:19:13 -0700

How do I get rid of this warning?

../NEO/NeoIncludes/CNeoIOBlock.h:85: warning: invalid access to
non-static data member `CNeoIOBlock::fPB' of NULL object
../NEO/NeoIncludes/CNeoIOBlock.h:85: warning: (perhaps the `offsetof'
macro was used incorrectly)

The line of code in question is

static CNeoIOBlock *GetIOBlock(NeoIOParams *aIOParams) {return
(CNeoIOBlock *)((char *)aIOParams - offsetof(CNeoIOBlock, fPB));}

which appears to be a function that takes a pointer to an object
member, and returns a pointer to the object.

--
Mark Wagner
_______________________________________________
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


  • Follow-Ups:
    • Re: Warning with offsetof macro?
      • From: Eric Albert <email@hidden>
    • Re: Warning with offsetof macro?
      • From: David Dunham <email@hidden>
  • Prev by Date: values not passed?
  • Next by Date: Re: Xcode's 'Find in Files' UI problems/questions
  • Previous by thread: values not passed?
  • Next by thread: Re: Warning with offsetof macro?
  • Index(es):
    • Date
    • Thread