🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #1599

g++ hash problems with typedefs and parameters

#1599
From: "Douglas C. Schmidt"
Date: Wed, 04 Jan 1989 05:16
39 lines
1629 bytes
Hi,

   The following demonstrates a ``bug'' with g++ 1.32 ( I'm not sure if this
is a bug or a feature! ).

   The code below is derived from the AT&T 1.2.1 cfront source code ( it
obviously compiles with cfront ;-) ).  

----------------------------------------
typedef class expr * Pexpr;
typedef class vec * Pvec;

Pexpr cdvec ( Pexpr vec );
----------------------------------------

However, g++ 1.32 doesn't like it:

----------------------------------------
g++ version 1.32.0

 /usr/public/lib/g++/gcc-cpp -+ -v -I/cd/ua/schmidt/include/ -undef
-D__GNU__ -D__GNUG__ -Dsparc -Dsun -Dunix foo.c /tmp/cca24119.cpp

GNU CPP version 1.32

 /usr/public/lib/g++/gcc-c++ /tmp/cca24119.cpp -quiet -dumpbase foo.c
-fstrength-reduce -finline-functions -fmemoize-lookups -fsave-memoized
-fchar-charconst -version -o /tmp/cca24119.s

GNU C++ version 1.32.0 (sparc) compiled by GNU C version 1.32.
foo.c:4: parse error before `vec'
----------------------------------------

Apparently, g++ thinks the parameter ``vec'' refers to a shorthand for
the typedefed ``class vec.''  This is not unreasonable behavior, but
it doesn't seem compatible with the AT&T version.

Doug
Technical Details
Message-ID: <8901032116.aa03208@PARIS.ICS.UCI.EDU>
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!uunet!tut.cis.ohio-state.edu!PARIS.ICS.UCI.EDU!schmidt%siam.ics.uci.edu

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!uunet!tut.cis.ohio-state.edu!PARIS.ICS.UCI.EDU!schmidt%siam.ics.uci.edu
From: schmidt%siam.ics.uci.edu@PARIS.ICS.UCI.EDU ("Douglas C. Schmidt")
Newsgroups: gnu.g++.bug
Subject: g++ hash problems with typedefs and parameters
Message-ID: <8901032116.aa03208@PARIS.ICS.UCI.EDU>
Date: 4 Jan 89 05:16:44 GMT
Sender: news@tut.cis.ohio-state.edu
Organization: GNUs Not Usenet
Lines: 39