gcc 4.6 embeded cpp 'feature'

phi gcc phi.gcc@gmail.com
Fri Sep 6 11:01:00 GMT 2013


Hi Gurus,

I got this with my xbuild arm32 gcc

CU82$ cat c.c
#define __extension__
#include <unistd.h>
int foo(){char b[4]; b[0]=0; read(0,b,4); return(b[0]);}


CU82$ arm-linux-gnueabi-gcc -E c.c |
           arm-linux-gnueabi-gcc -c -o c.o -O -xc -

CU82$

Meaning it all compile fine with no warnings or errors.

CU82$ arm-linux-gnueabi-gcc -c c.c -O
c.c: In function 'foo':
c.c:3:34: warning: ignoring return value of 'read', declared with attribute warn
_unused_result [-Wunused-result]

Meaning the embeded cpp missed the expansion of __extension__

Is this expected?

We heavily depend on cpp behave the same explicit or embeded


Cheers,
Phi



More information about the Gcc-help mailing list