On Feb 6, 2008 1:18 PM, Manuel López-Ibáñez <[EMAIL PROTECTED]> wrote: > On 06/02/2008, Felipe Contreras <[EMAIL PROTECTED]> 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? > > [EMAIL PROTECTED]:~$ cat felipe.c > typedef enum OMX_ERRORTYPE > { > OMX_ErrorNone = 0, > OMX_ErrorInsufficientResources = 0x80001000 > } OMX_ERRORTYPE; > [EMAIL PROTECTED]:~$ ~/personal/gcc/objdir/gcc/cc1 -Wall -Wextra > -Wconversion ~/felipe.c > [EMAIL PROTECTED]:~$ ~/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
0x80001000u and 0x80001000UL didn't work: gcc test.c -o test -pedantic test.c:7: warning: ISO C restricts enumerator values to range of 'int' This is with: gcc (GCC) 4.1.2 20070925 (Red Hat 4.1.2-33) -- Felipe Contreras