[GiNaC-devel] Improvements for the code for the Lanczos method.

Chris Dams Chris.Dams at mi.infn.it
Wed Jan 24 12:50:21 CET 2007


Dear Alexei,

On Thu, 18 Jan 2007, Sheplyakov Alexei wrote:

> First of all, libraries should not be spamming std{out,err}.

Surely they should not be "spamming" it. However, this code is mainly 
present to guard the code integrity. I.e., preventing that someone is 
going to unwittingly delete some line, or some such thing. So it really 
should never be executed.

> Secondly, exit(1) makes debugging unnecessary complicated (I really, 
> _really_ hate libraries which exit() on error!).

Same as before, this code really, _really_, should never be executed in 
the first place.

> Last, you should have 
> #include'ed
> the header <cstdlib> where exit is declared.

Okay, I'll include cstdlib then.

> I suggest to remove all that cruft and use exceptions instead.

I do not see what benefit exceptions bring to this situation. It could
only force the compiler to insert error handling code all over the place
where really none is needed. Noone should be catching this exit. Instead, 
if it is called, the code should be fixed.

Best wishes,
Chris



More information about the GiNaC-devel mailing list