This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]