• 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: Interesting preprocessor code behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interesting preprocessor code behavior


  • Subject: Re: Interesting preprocessor code behavior
  • From: Bill Royds <email@hidden>
  • Date: Thu, 3 Jul 2008 13:57:02 -0400


On 3-Jul-08, at 11:55 , Howard Moon wrote:

Preprocessor comparisons (like #if (A==B)) cannot be relied upon to consistently pass OR fail if either symbol is undefined.

An undefined symbol has the value 0 when evaluated, so if A is undefined, this expression depends on the value of B. It will NOT evaluate to false consistently, but to the value of
#if (0 ==B)
which evaluates to true if B is defined and equal to 0 or B is undefined as well.


_______________________________________________
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: 
 >Interesting preprocessor code behavior (From: Howard Moon <email@hidden>)

  • Prev by Date: Re: Interesting preprocessor code behavior
  • Next by Date: Reordering Tabs with IB 3.0
  • Previous by thread: Re: Interesting preprocessor code behavior
  • Next by thread: Re: Interesting preprocessor code behavior
  • Index(es):
    • Date
    • Thread