calling method via IMP that returns non id type - compiler warning
calling method via IMP that returns non id type - compiler warning
- Subject: calling method via IMP that returns non id type - compiler warning
- From: Ben Dougall <email@hidden>
- Date: Sun, 15 Feb 2004 16:59:00 +0000
i've used an IMP to call a method, and that method returns a typedeffed
type that isn't an object pointer -- not an id type that is. it all
works fine apart from it gives a warning. if i cast the returned value
from the IMP call the warning goes away -- but is that the way to fix
that?
so at the moment i'm using the IMP like so:
typedef u_int8_t *MyType;
...
MyType result = theMethodIMP(object, nil, value);
and the method that the IMP stands for/points to is declared like this:
- (MyType)theMethod:(unsigned)value;
the above IMP call line gives this warning:
warning: assignment from incompatible pointer type
but changing the IMP call line to:
MyType result = (MyType)theMethodIMP(object, nil, value);
stops the warning. is that how i should stop the warning, or is there
some other way i should be using?
thanks, ben.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.