This is the mail archive of the gcc-help@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]

typedef struct in C and C++


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



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