Thread View: gnu.g++.bug
1 messages
1 total messages
Started by "Douglas C. Schmidt"
Tue, 11 Oct 1988 19:52
More constructor/destructor madness!
Author: "Douglas C. Schmidt"
Date: Tue, 11 Oct 1988 19:52
Date: Tue, 11 Oct 1988 19:52
49 lines
1677 bytes
1677 bytes
[ok, so there are probably better ways to take a study break ;-)]
Hi,
The following program produces a fatal signal when compiled with
g++ 1.27 on Sparc WITHOUT -O (i.e., it compiles and executes fine with
-O). Furthermore, if the first line is uncommented the compiler
works.
Doug
----------------------------------------
// int main ( void );
// uncomment this to remove bug.
int i = 0;
class Foo {
public:
Foo ( void ) {
main (); // simply pathological!
printf("Yow\n");
}
~Foo ( void ) {
printf("Goodbye\n");
}
};
static Foo Main;
int main ( void) {
printf("Hello\n");
}
----------------------------------------
Diagnostics:
----------------------------------------
g++ version 1.27.0
echo use .cc filename extension!
use .cc filename extension!
/usr/public/lib/g++/gcc-cpp+ -v -I/cd/ua/schmidt/include/ -undef -D__GNU__ -D__GNUG__ -Dsparc -Dsun -Dunix test.C /tmp/cca19167.cpp
GNU CPP version 1.27.0
/usr/public/lib/g++/gcc-c++ /tmp/cca19167.cpp -quiet -dumpbase test.C -fchar-charconst -noreg -version -o /tmp/cca19167.s
At top level:
:54: warning: test.C:19: Segmentation violation
/usr/public/g++: Program c++ got fatal signal 11.
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