• 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: Optimization Level
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Optimization Level


  • Subject: Re: Optimization Level
  • From: Wim Lewis <email@hidden>
  • Date: Mon, 17 Oct 2016 11:49:15 -0700

On Oct 17, 2016, at 11:36 AM, koko <email@hidden> wrote:
> If I build a release configuration with the recommended optimization level (fastest, smallest) then this code
>
> void xxxxx::Clear(apointList &list)
> {
>    if ( ! &list )
>        return;
>
> }
>
> never returns when apointlis &list = 0x00000000 as shown in the debugger.

I'm not a C++ guru, but I believe that references are not allowed to be NULL — a reference is assumed to always point to a valid object. (This is one of the ways they differ from pointers.) Since no valid object can be at address 0, the compiler can optimize out that test.

If it's possible for a NULL to be passed into that method, it should probably take a pointer to an apointList instead of a reference to one.




 _______________________________________________
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: Optimization Level
      • From: koko <email@hidden>
References: 
 >Optimization Level (From: koko <email@hidden>)

  • Prev by Date: Optimization Level
  • Next by Date: Mysterious linker warning "direct access … to global weak symbol … cannot be overridden at runtime"
  • Previous by thread: Optimization Level
  • Next by thread: Re: Optimization Level
  • Index(es):
    • Date
    • Thread