• 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
Re: warning: argument to '&' not really an lvalue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >warning: argument to '&' not really an lvalue (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: warning: argument to '&' not really an lvalue
  • Next by Date: Re: IB3: DO NOT USE for Carbon!
  • Previous by thread: Re: warning: argument to '&' not really an lvalue
  • Next by thread: Xcode Internal Error with svn
  • Index(es):
    • Date
    • Thread