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: Is this a gcc bug or invalid code?


> 
> Before I open a bug report, I will ask it here:
> 
> [hjl@gnu-13 tmp]$ cat foo.c
> typedef struct A A;
> A *a;
> 
> typedef struct A
> {
>   int x;
> } A;
> [hjl@gnu-13 tmp]$ gcc -c foo.c
> foo.c:7: error: redefinition of typedef 'A'
> foo.c:1: error: previous declaration of 'A' was here
> [hjl@gnu-13 tmp]$ g++ -c foo.c
> [hjl@gnu-13 tmp]$ /opt/intel/cce/9.0/bin/icc -c foo.c
> 
> Is this a gcc bug or an icc extension?

Try in strict mode for ICC.  With Comeau C compiler,
it rejects it with the similar error message. 

-- Pinski


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