This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: G++ enums 'underlying type'
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Paolo Carlini <pcarlini at suse dot de>
- Cc: Paul Schlie <schlie at comcast dot net>, gcc at gcc dot gnu dot org
- Date: 29 Dec 2004 23:08:48 +0100
- Subject: Re: G++ enums 'underlying type'
- Organization: Integrable Solutions
- References: <BDF88F83.86B2%schlie@comcast.net> <41D32763.1030704@suse.de>
Paolo Carlini <pcarlini@suse.de> writes:
| 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
I think your question is more C++-centric than C -- Paul Schlie is
arguing about what looks like C rather than C++.
I believe that you need compiler support to detect the undelying type.
(unless you do unreliable tricks like playing with the maximum value).
-- Gaby