This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
typedef struct in C and C++
- To: gcc-help at gcc dot gnu dot org
- Subject: typedef struct in C and C++
- From: Martyn Tebby <martyntebby at yahoo dot com>
- Date: Wed, 17 Oct 2001 13:27:06 +0100
Whilst pulling C headers into a C++ program I came across the following
problem.
struct abc_t;
typedef struct abc_struct {} abc_t;
struct abc_t;
compiles fine as C, but fails as C++ with the errors
a.c:2: conflicting types for `typedef struct abc_struct abc_t'
a.c:1: previous declaration as `struct abc_t'
Is this correct standard behaviour?
Is there a way around it without changing the existing C headers?
Note:
I tried this with gcc 2.95.2, 2.95.3 and 3.0 (snapshot)
Martyn Tebby
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com