public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* re: egcs-1.1b C++ compile fails with redundant typedefs
@ 1998-09-07  7:42 Jack Howarth
  0 siblings, 0 replies; 3+ messages in thread
From: Jack Howarth @ 1998-09-07  7:42 UTC (permalink / raw)
  To: egcs-bugs

   I am seeing a similiar problem under linuxppc using egcs 1.1b/
binutils 2.9.1.0.11. In building anything like ddd that uses
the macros in <sys/wait.h>, I have to explicitly expand the macros for
the code to compile. I believe this this the same bug.
                            Jack

-- 
------------------------------------------------------------------------------
Jack W. Howarth, Ph.D.                                     231 Bethesda Avenue
NMR Facility Director                              Cincinnati, Ohio 45267-0524
Dept. of Molecular Genetics                              phone: (513) 558-4420
Univ. of Cincinnati College of Medicine                    fax: (513) 558-8474


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: egcs-1.1b C++ compile fails with redundant typedefs
  1998-09-06 15:38 Peter.Schauer
@ 1998-09-08 23:54 ` Alexandre Oliva
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Oliva @ 1998-09-08 23:54 UTC (permalink / raw)
  To: Peter.Schauer; +Cc: egcs-bugs

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* egcs-1.1b C++ compile fails with redundant typedefs
@ 1998-09-06 15:38 Peter.Schauer
  1998-09-08 23:54 ` Alexandre Oliva
  0 siblings, 1 reply; 3+ messages in thread
From: Peter.Schauer @ 1998-09-06 15:38 UTC (permalink / raw)
  To: egcs-bugs

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.

Tracked it down to TYPE_MAIN_VARIANT being different for SIG_TYP_I
(they are the same for SIG_TYP_CP), so comptypes fails and the error message
is produced. I have no idea why they are different though.

PS: I do know that this code is ugly, and the redundant typedefs should
be avoided, but ...

pes@bier_1129$ cat tp2.h
typedef void SIG_FUNC_TYP_I(int);
typedef SIG_FUNC_TYP_I *SIG_TYP_I;
pes@bier_1130$ cat tp2.cc
#include "tp2.h"
typedef void SIG_FUNC_TYP_I(int);
typedef SIG_FUNC_TYP_I *SIG_TYP_I;

typedef void SIG_FUNC_TYP_CP(int);
typedef void SIG_FUNC_TYP_CP(int);
typedef SIG_FUNC_TYP_CP *SIG_TYP_CP;
typedef SIG_FUNC_TYP_CP *SIG_TYP_CP;
pes@bier_1131$ gcc -v
Reading specs from /usr/local/gnu/gcc-e1.1b/lib/gcc-lib/sparc-sun-solaris2.5/egcs-2.91.57/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
pes@bier_1132$ gcc -c tp2.cc
tp2.cc:3: redefinition of `typedef void (* SIG_TYP_I)(int)'
tp2.h:2: `typedef void (* SIG_TYP_I)(int)' previously declared here

-- 
Peter Schauer			pes@regent.e-technik.tu-muenchen.de


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1998-09-08 23:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-09-07  7:42 egcs-1.1b C++ compile fails with redundant typedefs Jack Howarth
  -- strict thread matches above, loose matches on Subject: below --
1998-09-06 15:38 Peter.Schauer
1998-09-08 23:54 ` Alexandre Oliva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).