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

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
  • Follow-Ups:
    • Re: warning: argument to '&' not really an lvalue
      • From: Brady Duga <email@hidden>
    • Re: warning: argument to '&' not really an lvalue
      • From: Marshall Clow <email@hidden>
  • Prev by Date: Re: IB3 Frustration
  • Next by Date: Re: warning: argument to '&' not really an lvalue
  • Previous by thread: Re: Setting tab handling per project
  • Next by thread: Re: warning: argument to '&' not really an lvalue
  • Index(es):
    • Date
    • Thread