ImportC and nothrow/@nogc?

Dukc ajieskola at gmail.com
Sat Aug 24 06:23:22 UTC 2024


Walter Bright kirjoitti 21.8.2024 klo 22.42:
> On 8/19/2024 5:24 PM, Gregor Mückl wrote:
>> The C function interface has no notion of C++ exceptions (AFAIK it's 
>> following C specs, not C++),
> 
> C's setjmp/longjmp use the same exception throwing method.
> 

OTOH a C function `longjmp`ing is like a D function throwing 
unrecoverable errors. It's still `nothrow`, it's just that `setjmp`ing 
(like catching unrecoverables) is unsafe, since it can break the D type 
system by skipping destructors and `finally` blocks.


More information about the Digitalmars-d mailing list