This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Is this a gcc bug or invalid code?
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: hjl at lucon dot org (H. J. Lu)
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 4 May 2006 14:32:00 -0400 (EDT)
- Subject: 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