A89: Re: Size of an enum


[Prev][Next][Index][Thread]

A89: Re: Size of an enum




Hi!

> Let's say I define a type like this :
> 
> typedef enum
> {
>   First,
>   Second,
>   ...
> } My_Type;
> 
> ...
> My_Type var;
> ...
> 
> If I do that, 'var' will have a size of 16 bits, which is the size of
> the 'int' type in TIGCC. So the question is : how can I specify that
> 'My_Type' is, let's say, 8 bits wide ? 

You can not do this from the program itself, but check about command
line switches in TIGCC doc; If I remembered it well, somewhere exists
a switch for selecting the size of enums.

Zeljko Juric



Follow-Ups: