On May 12, 2007, at 12:11 PM, Richard B. Kreckel wrote:
Hi!
Ron Garret wrote:
When CLN was written, exceptions were not a mature specification nor technology: rethrowing an exception was undefined behaviour, and g++ created huge code when used without "-fno-exceptions". This has probably changed meanwhile... OK, but why hard-code a call to exit instead of (say) a user- specifiable callback or something like that? Is cln still being actively maintained? Can I submit a patch?
Sure you can!
Where do I send them?
Frankly, I would much prefer throwing an exception than the present form of "user specifialble callback".
Actually, the present form is not even a user-specifiable callback, it's a hard-coded call to exit.
However, I am very curious about the overhead incurred by compiling CLN without -fno-exceptions. If that really turns out to be negligible, I am all for throwing exceptions as that is so much more convenient. I suggest to start looking for the destructor overhead.
You don't need to compile the whole thing with exceptions enabled, only the parser. (And in fact, I think you don't even have to compile the parser with exceptions enabled, just the error functions. That's basically what I did on Linux by "overriding" their definitions and it seemed to work OK. Of course, I never stress-tested it for memory leaks. Let me do some experiments and I'll report back. rg