Re: help: about enum

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

 



Hi Gaurav,

Please see my inline comments.  Those were directly copied from the GCC
man page.

Regards,
Sagar.

On Tue, 2005-08-30 at 09:55 +0530, Gaurav Gautam, Noida wrote:
> 
> Hi,
> 
> 
> I want to know, how enums are handled in gcc. How do we map an enum value to the corresponding integer size.
>  -fshort-enums

           Allocate to an "enum" type only as many bytes as it needs for
the declared range of possible values.  Specifically, the "enum" type
will be
           equivalent to the smallest integer type which has enough
room.

           Warning: the -fshort-enums switch causes GCC to generate code
that is not binary compatible with code generated without that switch.
Use it to
           conform to a non-default application binary interface.
> What does the option -fshort-enums does. Plz explain me in detail.


> 
> Given an enum value, how do we calculate or determine that what size should the enum occupy.
> 
> Does all the enum have a same size of 4 bytes or does it varies depending on the initializing value?
> 
> 
> Regards
> Gaurav
> 

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux