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]

Re: G++ enums 'underlying type'


On Wed, 2004-12-29 at 18:12, Gabriel Dos Reis wrote:

> In C, enumerator are ints -- even though the associated enumeration
> type is considered a distinct types.  Only C++ allows for the smallest
> integer type as the underlying type; and C++ enumerators are not ints. 

In C, enumeration *constants* are ints.  Enumeration *variables* need
not be: they can be any integral type ([unsigned] [char|short|int]) that
can hold the entire range of the enumeration set.

R.


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