Re: Incorrect warning
Re: Incorrect warning
- Subject: Re: Incorrect warning
- From: Chris Espinosa <email@hidden>
- Date: Mon, 15 Nov 2004 16:38:36 -0800
On Nov 15, 2004, at 4:35 PM, Markian Hlynka wrote:
On Nov 15, 2004, at 14:39, Chris Espinosa wrote:
On Nov 15, 2004, at 1:03 PM, Markian Hlynka wrote:
Is there a way I've forgotten about or just aren't familiar with to
make all the constants in an enum {} be unsigned? They're all
defined as 4-char codes, which I thought were naturally unsigned to
begin with.
I'd like to know the answer to that one, as I tried to do it
recently, as well as tried to make an enum short. I didn't find a
way and had to give up.
For the former, no; enums are always integral types, meaning they are
always signed. There's no provision in the language definition to
change that.
For the latter, yes, you can find it in the gcc man page (
x-man-page://1/gcc ); it's -fshort-enums. Note that because the Mac
OS X ABI takes enumerators as parameters and includes them in packed
structures, changing the size of enumerators in compilation units
that call the Mac OS X ABI will possibly crash your application.
interesting, and thanks for the tip, but I don't want to change _all
enums, just some. This change sounds excessively global for my
purposes. Thanks, though!
You can, of course, add this as a per-target-per-file compile flag to
change just the enums in one compilation unit. But it really has to be
local to that one compilation unit.
Chris
_______________________________________________
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