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]
Other format: [Raw text]

Re: Two identical typedefs not allowed?


i can't think of a compiler flag to get gcc to accept that, but i may yet be
of some help.

i assume you're running into this because you're including the same header
twice, right?  or a nice little recursive tree of dependant headers?  that's
when this usually pops up.  try something like this in your headers:

/* start of projectname header.h */
#ifndef __PROJECTNAME_HEADER_H__
#define __PROJECTNAME_HEADER_H__

/* contents of projectname header.h */

#endif /* __PROJECTNAME_HEADER_H__ */
/*end of pojectname header.h */

hope it helps,
chris

----- Original Message -----
From: "Johan Walles" <johan.walles@appeal.se>
To: <gcc-help@gcc.gnu.org>
Sent: Thursday, November 22, 2001 10:47 AM
Subject: Two identical typedefs not allowed?


> Hi!
>
> When I try to compile the following code with gcc-3.0.2...
>
> typedef int adam;
> typedef int adam;
>
> ... I get the following error:
>
> redefinition.c:2: redefinition of `adam'
> redefinition.c:1: `adam' previously declared here
>
> Is there a flag that makes gcc accept this construct?
>
>    Cheers //Johan
>



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