Re: error handling

2014-12-17 Thread Niels Möller
t...@gmplib.org (Torbjörn Granlund) writes: > The error handler function would then use the knowledge of the > allocation functions to clean up the memory state, and probably longjump > to to deallocate stack. We've discussed such hacks for memory allocation before (but now I can't find the relev

Re: error handling

2014-12-17 Thread Torbjörn Granlund
t...@gmplib.org (Torbjörn Granlund) writes: [Moved thread from gmp-devel.] Oops, s/from/to/ -- Torbjörn Please encrypt, key id 0xC8601622 ___ gmp-devel mailing list gmp-devel@gmplib.org https://gmplib.org/mailman/listinfo/gmp-devel

Re: error handling

2014-12-17 Thread shoup
I agree that these global pointers to functions have a number of problems. I was going to say that for some situations, it would be better to have these choices made and compile/link time rather than run time. But I see from what you say that there are more complex scenarios to consider...oh wel

Re: error handling

2014-12-17 Thread Torbjörn Granlund
[Moved thread from gmp-devel.] I'd like to think of error handling also in a C perspective, and consider a few more problems at the same time. Which sources of exceptions do we have currently? 1 We divide by 0 to generate a SIGFPE. I think we do that for division by zero as well as some other