This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
help: about enum
- From: "Gaurav Gautam, Noida" <gauravga at noida dot hcltech dot com>
- To: <gcc at gcc dot gnu dot org>
- Date: Sat, 27 Aug 2005 13:55:30 +0530
- Subject: help: about enum
Hi,
Plz help me
I want to know, how enums are handled in gcc. How do we map an enum value to the corresponding integer size.
What does the option -fshort-enums does. Plz explain me in detail.
I could see the difference in the size of enums when I toggle the option. If the option is not given, then all the enum occupy the same 4 bytes irrespective of their value and 2147483647 is the maximum value that can fit in integer. But when I specify the option, the size varies and 2147483647 starts fitting in.
Plz explain this behaviour and how does it confirms to standard.
I want to know, given an enum value, how do we calculate or determine that what size should the enum occupy.
Regards
Gaurav