Re: warning: assignment makes integer from pointer without a cast
Re: warning: assignment makes integer from pointer without a cast
- Subject: Re: warning: assignment makes integer from pointer without a cast
- From: Stig Brautaset <email@hidden>
- Date: Tue, 16 Oct 2007 20:02:23 +0100
On 16 Oct 2007, at 17:36, Ryan Poling wrote:
I'm getting the following warning and I can't figure out how to
suppress it, or whether or not I really need to worry about it.
warning: assignment makes integer from pointer without a cast
The warning is on the following line of code which calls a
*private* method (meaning that I haven't declared a prototype in
the .h file and don't want to). I imagine the compiler thinks the
method will return an id and this is why I'm getting the error, but
do I need to worry about this? I tried creating a category in the
same .m file and declaring the prototype there, but I still get the
warning. Declaring the prototype in the .h file *does* make the
warning disappear, but I'd rather not declare it there because I
don't want consumers of the interface to call it.
So declare the prototype in the .m file. If you don't want to do that
you'd probably get away with simply putting the definition _above any
code that calls it_ inside your class[0]. The compiler is complaining
because at the time it is called it haven't seen a prototype for it
and therefore assumes that the method will return 'id'.
[0] this will work _almost_ anywhere, except for recursive methods.
Stig
--
http://code.brautaset.org
http://blog.brautaset.org
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden