What is wrong with core.stdc.signal ?

angel andrey.gelman at gmail.com
Fri Oct 27 23:57:48 UTC 2017


Core.stdc.signal.signal() requires that a signal handler function 
is "nothrow @nogc @system".
These attributes impose quite a limitation - one cannot even 
print which signal was accepted.
While if one imports this same function via "extern (C)" path, he 
can  freely throw and allocate memory in the signal handler. And 
this actually makes sense, as the handler function is called on 
top of the stack of where the code was running when the signal 
popped in, so it's like calling a function.
Why the limitation if it works ?



More information about the Digitalmars-d mailing list