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: Wrong warning? ISO C restricts enumerator values to range of ‘int’


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.


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