warning: argument to '&' not really an lvalue
warning: argument to '&' not really an lvalue
- Subject: warning: argument to '&' not really an lvalue
- From: Jerry Krinock <email@hidden>
- Date: Fri, 8 Feb 2008 13:59:35 -0800
NSURL* and CFURLRef are "toll-free bridged". So, for example, if a
function requires a CFURLRef*, I'd write this:
NSURL* aURL ;
LSSharedFileListItemResolve(
item,
0,
&(CFURLRef)aURL,
NULL) ;
But in Xcode 3.0 with the 10.5 sdk, this gives me:
warning: argument to '&' not really an lvalue;
this will be a hard error in the future
I don't get what they mean and can't find that searching Developer
Tools Reference Library.
I can avoid the warning by being more pedantic:
CFURLRef cfURL ;
CFURLRef* cfURL_p = &cfURL ;
LSSharedFileListItemResolve(
item,
0,
cfURL_p,
NULL) ;
NSURL* aURL = (NSURL*)*cfURL_p ;
Is there a simpler way to avoid the warning?
Both snippets above work. I think my original snippet is fine. Why
doesn't Xcode like it?
Thanks,
Jerry Krinock
_______________________________________________
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