This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Wrong warning? ISO C restricts enumerator values to range of âintâ
- From: Andreas Schwab <schwab at suse dot de>
- To: "Felipe Contreras" <felipe dot contreras at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 06 Feb 2008 13:47:41 +0100
- Subject: Re: Wrong warning? ISO C restricts enumerator values to range of âintâ
- References: <94a0d4530802060305j7c78c66ekc5a8278689de3810@mail.gmail.com>
"Felipe Contreras" <felipe.contreras@gmail.com> writes:
> This is what ISO C says:
>
> Each enumerated type shall be compatible with char, a signed integer
> type, or an unsigned integer type. The choice of type is
> implementation-defined,110) but shall be capable of representing the
> values of all the members of the enumeration.
The standard also says:
The expression that deïnes the value of an enumeration constant shall
be an integer constant expression that has a value representable as an
int.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, MaxfeldstraÃe 5, 90409 NÃrnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."