This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
GCC 4.5.0 Reports invalid warning
- From: J Decker <d3ck0r at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 15 Jul 2010 16:59:17 -0700
- Subject: GCC 4.5.0 Reports invalid warning
This is the code.
------------------------------
#define PointerA struct a *
void f( PointerA );
typedef struct a * PA;
struct a { int x; };
void f( PA a )
{
}
---------------------------------
This is the output
warning: 'struct a' declared inside parameter list
warning: its scope is only this definition or declaration, which is
probably not what you want
error: conflicting types for 'f'
note: previous declaration of 'f' was here
--------------------------------
This is valid C code by every other compiler.
If there is already a thread about this, or a bug about it, I didn't
find it searching this lsit or the bugs database.
If I move even the 'typedef struct a *PA' above the first function,
then 'struct a' is apparently defined, even if it is not.