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