• 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: typedef enums are now unsigned?!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: typedef enums are now unsigned?!


  • Subject: Re: typedef enums are now unsigned?!
  • From: Wade Tregaskis <email@hidden>
  • Date: Sat, 07 Mar 2009 13:13:20 -0800

Well, on PPC and X86 the method was indeed returning -1 when an error occurred, but on PPC64 and X86-64, it was instead returning 2^32-1, which is SOP for a method returning an unsigned int, not an int. This, of course, threw off various checks for -1, and flew in the face of what it says in TCPL.

I was able to work around this by changing the results of an error from -1 to INT_MAX, but this raises several questions: Why did this change in the 64-bit compilers, where is this change documented, and how can this behavior be controlled?

I also have been bitten by this exact problem. It's one of many reasons not to use enums at all; until C lets you declare typed enums, they're just little time bombs.


Wade
_______________________________________________
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: 
 >typedef enums are now unsigned?! (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: NSZombieEnabled still allows crash. Was: (gdb) Won't Answer...
  • Next by Date: Basic IB-Plugin not working in Cocoa Simulator
  • Previous by thread: Re: typedef enums are now unsigned?!
  • Next by thread: Re: typedef enums are now unsigned?!
  • Index(es):
    • Date
    • Thread