Article View: gnu.g++.help
Article #57Rational class bug?
From: Ron Sommeling
Date: Mon, 13 Apr 1992 15:05
Date: Mon, 13 Apr 1992 15:05
26 lines
1509 bytes
1509 bytes
I'm trying to use the Rational class of GNU C++.
The following program gives a segmentation fault at execution time:
===============================================================================
#include <iostream.h>
#include <Rational.h>
main() {
cout << Rational(2,3) << endl;
}
===============================================================================
% g++ -v t.cc
Reading specs from /usr/local/lib/gcc/sun4/2.0/specs
gcc version 2.0
/usr/local/lib/gcc/sun4/2.0/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix t.cc /usr/tmp/cca29969.cpp
GNU CPP version 2.0 (sparc)
/usr/local/lib/gcc/sun4/2.0/cc1plus /usr/tmp/cca29969.cpp -quiet -dumpbase t.cc -version -o /usr/tmp/cca29969.s
GNU C++ version 2.0 (sparc) compiled by GNU C version 2.0.
as -o t.o /usr/tmp/cca29969.s
ld -e start -dc -dp /lib/crt0.o -L/usr/local/lib/gcc/sun4/2.0/ -L/usr/local/lib/gcc/ -L/usr/local/lib/ t.o -lg++ -lgcc -lc -lgcc
% ./a.out
Segmentation fault
Does anyone know whether this is a library bug or a compiler bug?
It used to work with g++ 1.39. Any help is appreciated.
Ron Sommeling <Ron.Sommeling@cwi.nl>
Technical Details
Message-ID:
<5852@charon.cwi.nl>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!cwi.nl!ronShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!cwi.nl!ron From: ron@cwi.nl (Ron Sommeling) Newsgroups: gnu.g++.help Subject: Rational class bug? Message-ID: <5852@charon.cwi.nl> Date: 13 Apr 92 15:05:52 GMT Sender: news@cwi.nl Distribution: gnu Organization: CWI, Amsterdam Lines: 26