This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
No Subject
- To: egcs at cygnus dot com
- From: "Peter Garner" <peter dot garner at toward dot com>
- Date: Thu, 2 May 96 00:24:44 EDT
- CC: bothner at cygnus dot com
- Reply-To: <peter dot garner at toward dot com>
Good Day All!
I am rather new to ecgs so I apologize if I should have
sent this to egcs-bugs instead of egcs.
I downloaded and built the 1990425 snapshot, since I am
in need of a more or less ISO compliant compiler. I patched
streambuf.h and streambuf.cc so that it would throw an
ios::failure exception (that class being a child of
exception per the ISO draft.) When I attempt to use this I
get a segmentation fault. I thought you might like to see
this. I have attached a file test.tar that contains the
difference between the original and patched h files (hdiff)
and the difference between the original and patched cc
file (ccdiff.txt) and fexcptst.cpp, and simple program
that causes the segmentation fault.
Lastly, please pardon me, but I noticed that the original
threw an exception by pointer. In general isn't that a
very bad idea? I was always taught to write a copy
constructor for all exceptions and always throw by value,
never by new. Doesn't a construct like :
throw new failure ( this )
lead to a memory leak since it becomes the responsibility
of the catch block to delete the pointer?
Thanks
Peter