This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: egcs-1.1b C++ compile fails with redundant typedefs
- To: "Peter.Schauer" <Peter dot Schauer at Regent dot E-Technik dot TU-Muenchen dot DE>
- Subject: Re: egcs-1.1b C++ compile fails with redundant typedefs
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 09 Sep 1998 01:01:30 z
- Cc: egcs-bugs at cygnus dot com
- References: <199809061954.VAA27436@red.regent.e-technik.tu-muenchen.de>
Peter Schauer <Peter.Schauer@Regent.E-Technik.TU-Muenchen.DE> writes:
> egcs-1.1b reports an error with certain redundant typedefs, if the first
> typedef is in a header file and the redundant second typedef is in the
> main source file. An example is appended below.
I could reproduce the problem without the need for a separate include
file. The problem will show up in the following code snippet:
> typedef void SIG_FUNC_TYP_I(int);
> typedef SIG_FUNC_TYP_I *SIG_TYP_I;
> typedef void SIG_FUNC_TYP_I(int);
> typedef SIG_FUNC_TYP_I *SIG_TYP_I;
Looks like, in spite of accepting the duplicate typedef of
SIG_FUNC_TYP_I, the type descriptor associated with the second typedef
is different from the first one, so SIG_FUNC_TYP_I refer to different
types in lines 2 and 4, so the duplicate typedef of SIG_TYP_I is
rejected, as it corresponds to a typedef to an apparently different
type.
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil