Going by gcc version 4.4.2, it appears that saying
typedef struct foo foo;
// more code here - like function declarations taking/returning foo*
// then, in its own source file:
typedef struct foo
{
int bar;
} foo;
is legal in C++ but not in C.
Of course I have a body of code that compiles fine in C++ by using the foo type but it appears I must make it use struct foo (in the header file) to get it to work with some C code another developer wrote.
Is there a way to predeclare a struct typedef foo foo in gcc C without getting a "redefinition of typedef 'foo'" error when compiling for C? (I don't want the marginally illegal and less clean underscore solution of *struct typedef _foo foo*)