Re: Specifying "enum" data size
Re: Specifying "enum" data size
- Subject: Re: Specifying "enum" data size
- From: Chris Espinosa <email@hidden>
- Date: Fri, 23 Sep 2005 17:17:02 -0700
On Sep 23, 2005, at 5:04 PM, Mark Wagner wrote: How do I specify the size of an "enum" value? I've got a program that links to a number of static libraries. In one of them, an "enum" for the typedef'd "BoolEnum" type is one bit, while in another, it's 32 bits. Needless to say, this causes problems when passing structs containing BoolEnums back and forth.
Does GCC recognize the "#pragma enumsalwaysint" pragma? Might the presence of this in some of the source files be causing problems?
I'm using XCode 1.5 and GCC 3.3, and I'm writing in C.
The only control available is -fshort-enums ("Short Enumeration Constants") which you can apply on a target or on a single file. There's no pragma to make this apply only to specific enums within a file. This will make enums as small as possible for the range of enums given.
Notice that Mac OS X frameworks often declare structs that contain enumerated values, so changing the size of enums might make your code unable to call Mac OS X system functions.
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