This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

No Subject


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





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]