This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: G++ enums 'underlying type'
- From: Paul Brook <paul at codesourcery dot com>
- To: gcc at gcc dot gnu dot org
- Cc: Paul Schlie <schlie at comcast dot net>
- Date: Wed, 29 Dec 2004 21:54:19 +0000
- Subject: Re: G++ enums 'underlying type'
- Organization: CodeSourcery
- References: <BDF88F83.86B2%schlie@comcast.net> <41D32763.1030704@suse.de>
On Wednesday 29 December 2004 21:53, Paolo Carlini wrote:
> Paul Schlie wrote:
> >Agreed, to clarify: an enumeration (enumerated type, i.e. enum)
> >representation need be no larger than the smallest compatible integer
> >type, which I believe was the question.
>
> Actually, the question was rather different: which is the *actual*
> representation
> used by one specific implementation, that is the GNU C++ compiler? I know
> what the standard says in general about this, but, having noticed that
> even for an
> empty enum the underlying type appear to be 4-bytes wide, I wondered
> whether smaller underlying types are ever used in our implementation...
See -fshort-enums
Paul