Re: warning: argument to '&' not really an lvalue
Re: warning: argument to '&' not really an lvalue
- Subject: Re: warning: argument to '&' not really an lvalue
- From: Brady Duga <email@hidden>
- Date: Fri, 8 Feb 2008 14:08:50 -0800
On Feb 8, 2008, at 1:59 PM, Jerry Krinock wrote:
I don't get what they mean and can't find that searching Developer
Tools Reference Library.
I think it wants the thing you are taking the address of to be an
lvalue. The result of a cast isn't an lvalue, hence the warning. So,
this is illegal (assuming the cast is legal):
FooType foo;
BarType bar;
(BarType)foo = bar;
Instead, you would do:
foo = (FooType)bar;
Is there a simpler way to avoid the warning?
Instead of casting and taking the address of the cast, take the
address and cast the result, like so:
NSURL* aURL ;
LSSharedFileListItemResolve(
item,
0,
(CFURLRef*)&aURL,
NULL) ;
That should now be taking the address of a legal lvalue. Or I am
entirely wrong, which is always possible. Hey, what do you want from
free help? :)
--Brady
_______________________________________________
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