Thread View: gnu.g++.bug
2 messages
2 total messages
Started by Kim Coleman
Fri, 17 Mar 1989 22:26
g++ 1.34.0 bug with -g
Author: Kim Coleman
Date: Fri, 17 Mar 1989 22:26
Date: Fri, 17 Mar 1989 22:26
40 lines
2307 bytes
2307 bytes
The following program was once String.h out of our versio of OOPS. It causes
g++ V1.34.0 to get a segmentation violation when compiled with -g. I'm using
g++ configured for SUN3. Compilation trace follows program
//
// This class declaration will cause a segmentation violation in g++ 1.34
// IF compiled with the -g option. The problem goes away if <problem> is
// not overloaded, if one of the overloads is not a friend, if the friend'ly
// overload isn't inlined, or if you don't compile with -g. Once upon a
// time, this was String.h out of the OOPs library, and <problem> was an
// operator of SubString.
//
class SubString {
char* sp; // substring pointer
unsigned sl; // substring length
public:
SubString();
// can't take this out
void problem(const char* cs);
// this must be inlined and
// must overload above func
// must also be a friend
friend void problem(const int& i) {}
};
g++ version 1.34.0
/pdd/pde2/gnu/test/usr/local/lib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -Dmc68020 String.cc /tmp/cca03222.cpp
GNU CPP version 1.34
/pdd/pde2/gnu/test/usr/local/lib/gcc-c++ /tmp/cca03222.cpp -quiet -dumpbase main.cc -noreg -version -G -o /tmp/cca03222.s
GNU C++ version 1.34.0 (68k, MIT syntax) compiled by GNU C version 1.34.
In function void problem (const int &):
String.cc:19: Segmentation violation
Program c++ got fatal signal 11
----------------------------------------
Kim Coleman {the world}!mcnc!rti!dg-rtp!coleman
Data General, Research Triangle Park, NC
g++ 1.34.0 bug with -g
Author: Kim Coleman
Date: Fri, 17 Mar 1989 22:49
Date: Fri, 17 Mar 1989 22:49
39 lines
2336 bytes
2336 bytes
The following program was once String.h out of our versio of OOPS. It causes
g++ V1.34.0 to get a segmentation violation when compiled with -g. I'm using
g++ configured for SUN3. Compilation trace follows program
//
// This class declaration will cause a segmentation violation in g++ 1.34
// IF compiled with the -g option. The problem goes away if <problem> is
// not overloaded, if one of the overloads is not a friend, if the friend'ly
// overload isn't inlined, or if you don't compile with -g. Once upon a
// time, this was String.h out of the OOPs library, and <problem> was an
// operator of SubString.
//
class SubString {
char* sp; // substring pointer
unsigned sl; // substring length
public:
SubString();
// can't take this out
void problem(const char* cs);
// this must be inlined and
// must overload above func
// must also be a friend
friend void problem(const int& i) {}
};
g++ version 1.34.0
/pdd/pde2/gnu/test/usr/local/lib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -Dmc68020 String.cc /tmp/cca03222.cpp
GNU CPP version 1.34
/pdd/pde2/gnu/test/usr/local/lib/gcc-c++ /tmp/cca03222.cpp -quiet -dumpbase main.cc -noreg -version -G -o /tmp/cca03222.s
GNU C++ version 1.34.0 (68k, MIT syntax) compiled by GNU C version 1.34.
In function void problem (const int &):
String.cc:19: Segmentation violation
Program c++ got fatal signal 11
----------------------------------------
Kim Coleman {the world}!mcnc!rti!dg-rtp!coleman
Data General, Research Triangle Park, NC
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads