egcs-1.1b C++ compile fails with redundant typedefs

Alexandre Oliva oliva@dcc.unicamp.br
Tue Sep 8 23:54:00 GMT 1998


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




More information about the Gcc-bugs mailing list