Article View: gnu.g++.bug
Article #1474several problems with g++ 1.27 on sparc
From: "Douglas C. Schmidt"
Date: Tue, 04 Oct 1988 20:48
Date: Tue, 04 Oct 1988 20:48
50 lines
1500 bytes
1500 bytes
Hi,
The following program causes several problems for g++ 1.27.
1. When compiled with the -gg and -O flags it gets a fatal signal.
2. When compiled ``normally,'' (i.e., would -gg) the resulting
code gets a segmentation fault when executed. However, it works
fine with cfront 1.2.1.
Also, there seems to be a problem with the debugger (gdb+ 2.8) running
under the Sun OS 4.0. Since ld++ doesn't recognize -Bstatic I am
generally unable to debug g++ code under 4.0. Is there a workaround
for this?
Here's the code:
----------------------------------------
#include <stream.h>
class foo {
public:
char buf[100];
foo() {
strcpy(buf,"I am the default base");
}
virtual ~foo() {
cout << buf << "\n";
}
};
class bar : foo {
public:
bar() {
strcpy(foo::buf,"I am derived constructor");
}
~bar() {
cout << "I am the derived destructor!" << "\n";
}
};
main() {
foo foobar;
bar Foobar;
}
----------------------------------------
thanks,
Doug
Technical Details
Message-ID:
<8810041348.aa24159@PARIS.ICS.UCI.EDU>Path:
arc1-ca.pugleaf.net!utzoo!telly!ddsw1!mcdchg!rutgers!tut.cis.ohio-state.edu!ORION.CF.UCI.EDU!schmidt%crimee.ics.uci.eduShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!mcdchg!rutgers!tut.cis.ohio-state.edu!ORION.CF.UCI.EDU!schmidt%crimee.ics.uci.edu
From: schmidt%crimee.ics.uci.edu@ORION.CF.UCI.EDU ("Douglas C. Schmidt")
Newsgroups: gnu.g++.bug
Subject: several problems with g++ 1.27 on sparc
Message-ID: <8810041348.aa24159@PARIS.ICS.UCI.EDU>
Date: 4 Oct 88 20:48:05 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 50