Should core.stdc.signal.signal be nothrow @nogc??

Bottled Genie via Digitalmars-d digitalmars-d at puremagic.com
Mon May 16 04:06:39 PDT 2016


To be specific, I am trying to get an automatic backtrace 
generated for my d application in case of segfaults, using the 
technique shown in the following link:

http://stackoverflow.com/a/77336

Going by the code snippet in the link I have to pass a pointer to 
function handler as an argument to signal. And signal having 
being declared as @nogc nothrow expects handler to have the same 
attributes.

But handler calls backtrace and backtrace_symbols_fd which are 
declared in module core.sys.linux.execinfo and do not have @nogc 
attribute, thus making it impossible for me to specify @nogc with 
the handler function.

I believe the solution lies in adding @nogc for all the functions 
in execinfo module. Am I missing something?

Regards
- Genie


More information about the Digitalmars-d mailing list