Re: typedef enums are now unsigned?!
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