• 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: Greg Guerin <email@hidden>
  • Date: Thu, 3 Jul 2008 10:54:25 -0700

Clark Cox wrote:

#if MY_UNDEFINED_SYMBOL == ONE
...etc...

The OP mentioned the problem was with #elif, which could be significant.

The OP did not mention which version of gcc was used, which could also be significant.

It was also not mentioned what the order of operands for the fail- case was. DEF==UNDEF could differ from UNDEF==DEF (and would be a bug).

FWIW, the classical way to avoid the problem is:
  #if (defined(X) && ...expression involving X...)

  -- GG

_______________________________________________
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: Interesting preprocessor code behavior
      • From: "Clark Cox" <email@hidden>
  • Prev by Date: Re: IB: Inserting a parent item in a splitview pane?
  • Next by Date: Re: Interesting preprocessor code behavior
  • Previous by thread: Re: Interesting preprocessor code behavior
  • Next by thread: Re: Interesting preprocessor code behavior
  • Index(es):
    • Date
    • Thread