by jandrese · 2y ago · 0 comments
I have seen some libraries that do error handling via the user passing a callback for a longjmp, but even that seems ill advised. Fortunately it is always optional.
Re. SIGFPE, to be fair, it feels a bit like the "asynchronous vs. synchronous abort¹" thing on CPUs; synchronous aborts are reasonably doable while on asynchronous aborts you're pretty much left with torching things down far and wide.
(SIGFPE should hopefully be synchronous; it's in fact closely connected to sync/async CPU aborts...)
[¹ frequently also called exceptions, depending on the CPU architecture, but this post already uses "exception" for the language level concept]