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: "Manuel López-Ibáñez" <lopezibanez at gmail dot com>
- To: "Felipe Contreras" <felipe dot contreras at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 6 Feb 2008 12:18:43 +0100
- Subject: Re: Wrong warning? ISO C restricts enumerator values to range of ‘int’
- References: <94a0d4530802060305j7c78c66ekc5a8278689de3810@mail.gmail.com>
On 06/02/2008, Felipe Contreras <felipe.contreras@gmail.com> wrote:
>
> So, shouldn't gcc allow this without warnings then?
>
> typedef enum OMX_ERRORTYPE
> {
> OMX_ErrorNone = 0,
> OMX_ErrorInsufficientResources = 0x80001000
> } OMX_ERRORTYPE;
>
And what warning do you get and with which version of GCC you get it?
manu@localhost:~$ cat felipe.c
typedef enum OMX_ERRORTYPE
{
OMX_ErrorNone = 0,
OMX_ErrorInsufficientResources = 0x80001000
} OMX_ERRORTYPE;
manu@localhost:~$ ~/personal/gcc/objdir/gcc/cc1 -Wall -Wextra
-Wconversion ~/felipe.c
manu@localhost:~$ ~/personal/gcc/objdir/gcc/cc1 --version
GNU C (GCC) version 4.3.0 20080122 (experimental) (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.3.0 20080122 (experimental), GMP
version 4.2.2, MPFR version 2.3.0.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Cheers,
Manuel.