This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Two identical typedefs not allowed?
- From: "Chris Trawick" <hazard at lords dot com>
- To: "Johan Walles" <johan dot walles at appeal dot se>
- Cc: <gcc-help at gcc dot gnu dot org>
- Date: Thu, 22 Nov 2001 11:18:47 -0500
- Subject: Re: Two identical typedefs not allowed?
- References: <3BFD1E28.80805@appeal.se>
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
>