From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Peter Garner" To: egcs@cygnus.com Cc: bothner@cygnus.com Subject: No Subject Date: Fri, 01 May 1998 21:25:00 -0000 Message-id: <9605020020.AA1704454@piglet.toward.com> X-SW-Source: 1998-05/msg00026.html 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 waismail@quake.think.com