🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

g++ 1.32 balks at C++ code.

#1598
From: "Douglas C. Schmidt"
Date: Tue, 03 Jan 1989 06:24
32 lines
1432 bytes
Hi,

  The following example demonstrates an error with g++ 1.32:

----------------------------------------
class X {
public:
   static int si;   
};

int *pi = &X::si;
----------------------------------------

This should compile and execute correctly ( see bottom page 313 of
the 1988 USENIX C++ Proceedings ).  However, g++ complains as follows:

----------------------------------------
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 test.C /tmp/cca17054.cpp
GNU CPP version 1.32
 /usr/public/lib/g++/gcc-c++ /tmp/cca17054.cpp -quiet -dumpbase test.C
-fstrength-reduce -finline-functions -fmemoize-lookups -fsave-memoized
-fchar-charconst -noreg -version -o /tmp/cca17054.s
GNU C++ version 1.32.0 (sparc) compiled by GNU C version 1.31.
test.C:6: initialization between incompatible pointer types
----------------------------------------

cfront has no problems with this.

Doug
Technical Details
Message-ID: <8901022227.aa13099@PARIS.ICS.UCI.EDU>
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!killer!mit-eddie!bloom-beacon!tut.cis.ohio-state.edu!PARIS.ICS.UCI.EDU!schmidt%crimee.ics.uci.edu

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!killer!mit-eddie!bloom-beacon!tut.cis.ohio-state.edu!PARIS.ICS.UCI.EDU!schmidt%crimee.ics.uci.edu
From: schmidt%crimee.ics.uci.edu@PARIS.ICS.UCI.EDU ("Douglas C. Schmidt")
Newsgroups: gnu.g++.bug
Subject: g++ 1.32 balks at C++ code.
Message-ID: <8901022227.aa13099@PARIS.ICS.UCI.EDU>
Date: 3 Jan 89 06:24:58 GMT
Sender: news@tut.cis.ohio-state.edu
Organization: GNUs Not Usenet
Lines: 32