This is the mail archive of the gcc-bugs@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]

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


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



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