Article View: gnu.gcc.bug
Article #1179gcc-2.2.2 libg++-2.2 a bug ?
From: Laurenz Wiskott
Date: Fri, 09 Oct 1992 16:38
Date: Fri, 09 Oct 1992 16:38
55 lines
1683 bytes
1683 bytes
Dear 'GNU',
We are just changing from the AT&T C++ compiler to your gcc-2.2.2 with
the libg++-2.2. And the bugs changes also. I think I've found a bug
concerning pointer assignment to a pointer of a pointer inside a
global declared class. Here follows a simple example:
----------------------------------------------------------------------
#include <stream.h>
class TestClass
{
public:
char *string;
char **stringPtr;
TestClass() {
stringPtr = &string;
};
void testNewDelete(char flag) {
char *localString;
cerr << flag <<endl; (*stringPtr) = localString;
cerr << flag <<endl;
};
};
char *string;
char **stringPtr;
TestClass outerTestClass;
main()
{
stringPtr = &string;
char *localString;
cerr << "A" <<endl; (*stringPtr) = localString;
TestClass innerTestClass;
cerr << "B" <<endl; innerTestClass.testNewDelete('b');
cerr << "C" <<endl; outerTestClass.testNewDelete('c');
cerr << "D" <<endl;
};
-----------------------------------------------------------------
I got always a Segmentation fault for line 'C' and can't see why.
Kind regards, Laurenz Wiskott.
Technical Details
Message-ID:
<9210091438.AA05379@juno.neuroinformatik.ruhr-uni-bochum.de>Path:
arc1-ca.pugleaf.net!sparky!uunet!convex!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!juno.neuroinformatik.ruhr-uni-bochum.de!laurenzShow Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug Path: arc1-ca.pugleaf.net!sparky!uunet!convex!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!juno.neuroinformatik.ruhr-uni-bochum.de!laurenz From: laurenz@juno.neuroinformatik.ruhr-uni-bochum.de (Laurenz Wiskott) Subject: gcc-2.2.2 libg++-2.2 a bug ? Message-ID: <9210091438.AA05379@juno.neuroinformatik.ruhr-uni-bochum.de> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Fri, 9 Oct 1992 16:38:46 GMT Approved: bug-gcc@prep.ai.mit.edu Lines: 60