• 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: Bug in Debugger?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in Debugger?


  • Subject: Re: Bug in Debugger?
  • From: Howard Moon <email@hidden>
  • Date: Thu, 30 Apr 2009 08:41:42 -0700


On Apr 30, 2009, at 7:58 AM, Olivier Tristan wrote:

You're looking for trouble if you don't initialise your first enum.

enum {Lat1 = 0, Lon0, Lat0, Lon1};

Otherwise it may not be 0 if you have other enums in the same file.

My 2 cents.

I'm pretty sure that's not correct. The C++ standard dictates that for any given enum statement, the value of the first enumerator (i.e., Lat1, in this case) is 0 unless explicitly assigned a constant value. Whether there are other enum statements in the same "file" is irrelevant. While each subsequent enumerator (in a given enum statement) is assigned the value of the previous enumerator plus 1 (unless a constant is assigned to it), this pattern does not carry over from previous enum statements. The first enumerator means the first enumerator in that enum statement, not the first in the "file". So if you have ten enum statements, then each one will start with the constant value 0 (unless explicitly assigned a different value). They do not start with 1 more than the last enumerator in some earlier enum statement.


-Howard


_______________________________________________ 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: 
 >Bug in Debugger? (From: "McLaughlin, Michael P." <email@hidden>)
 >Re: Bug in Debugger? (From: Olivier Tristan <email@hidden>)

  • Prev by Date: Facing an issue with leaks utility in mac in usage with the xcode project
  • Next by Date: Re-"Targeting" to build a bundle
  • Previous by thread: Re: Bug in Debugger?
  • Next by thread: Re: Bug in Debugger?
  • Index(es):
    • Date
    • Thread