Re: [Lapackpp-devel] error handling
Status: Beta
Brought to you by:
cstim
From: Christian S. <sti...@tu...> - 2006-11-24 14:58:28
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Dominik Wagenfuehr schrieb: >> However, the assertions in lapackpp are intended to check for > *programming* errors. > >> a failed assertion should indeed print an error message including the >> source code file name, line number, and the failed condition. > > Without a console no output! :) As I said before if you use your in lib > in a GUI-Tool the tool just quits without any hint why it does crash... > Of course it's a programming error of the GUI-programmer because he has > made a mistake in matrix allocation or something, but I do not know if a > user cares about that. He only sees his GUI crash and loose all data. ;) I still believe modifying the assertions is the wrong place to do something about this. As for the output - I think this is usually redirected to ~/.xsession-errors, and you could just as well redirect the stdout of your GUI-Tool to somewhere else. Additionally, you can install a different handler for abort()... but whatever. You've challenged me to do something here. By now I've modified the LaException class so that you can switch the assert() behaviour from the normal abort() to throwing a LaException exception. To do this, you will have to uncomment some lines in the laexcp.h header file, which will effectively redefine the assert() macro so that it throws an exception instead of aborting. So: Checkout the latest CVS code; change the laexcp.h header; compiler and install; and at the next failed assert() you will get a thrown LaException instead of a failed assert. Is this what you wanted? Christian -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQCVAwUBRWcIe2XAi+BfhivFAQKpLQP/dtQ7x+58g+nqSPPSIR5azNkjOB0u2wQ4 3Iqr331itGsngCGs9z9ZFcBH8YM2R5xQ/AS+s5mkE4/PGFsOka/pwOVlDF2dh+gd Eq1peR918lFLiiRnDm5fIsXgGdEocjJO+cwssZ1S6tzVIu5VYv8HWypW9YtlUkCg rSwydZirhRw= =/Bp9 -----END PGP SIGNATURE----- |