• 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: New C++ warning about comparing this==NULL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New C++ warning about comparing this==NULL


  • Subject: Re: New C++ warning about comparing this==NULL
  • From: Doug Hill <email@hidden>
  • Date: Wed, 02 Dec 2015 17:18:39 -0800

ISO/IEC Standard 14882-2003 (e.g. C++ 2003)

Section 1.9.4

"Certain other operations are described in this International Standard as undefined (for example, the effect of dereferencing the null pointer). [Note: this International Standard imposes no requirements on the behavior of programs that contain undefined behavior. ]”

On Dec 2, 2015, at 5:11 PM, Roland King <email@hidden> wrote:

My understanding is that the C++ spec unequivocally defines this as an error and therefor it shouldn’t be happening at all.

That’s the crux of Jens’ question. Which version of the C++ spec actually includes wording which makes this undefined behaviour? There’s drafts and proposals for language which would unarguably make it so, but I haven’t yet found a version of the specification which currently includes that language. There’s evidence that members of the C++ working group feel it ought to be undefined, despite having answered the exact question about its legality in 2001 saying that yes it’s legal, but it’s not clear they’ve acted on it.

All hair-splitting in the end. If the compiler you’re using considers it undefined behaviour then you don’t have a lot of options but to stop using it if you want to avoid undefined results.

 _______________________________________________
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: New C++ warning about comparing this==NULL
      • From: Jens Alfke <email@hidden>
References: 
 >New C++ warning about comparing this==NULL (From: Jens Alfke <email@hidden>)
 >Re: New C++ warning about comparing this==NULL (From: Jonathan Prescott <email@hidden>)
 >Re: New C++ warning about comparing this==NULL (From: Jens Alfke <email@hidden>)
 >Re: New C++ warning about comparing this==NULL (From: Doug Hill <email@hidden>)
 >Re: New C++ warning about comparing this==NULL (From: Roland King <email@hidden>)

  • Prev by Date: Re: New C++ warning about comparing this==NULL
  • Next by Date: Re: New C++ warning about comparing this==NULL
  • Previous by thread: Re: New C++ warning about comparing this==NULL
  • Next by thread: Re: New C++ warning about comparing this==NULL
  • Index(es):
    • Date
    • Thread