nothrow in druntime win32 C bindings

Andrej Mitrovic andrej.mitrovich at gmail.com
Thu Dec 27 07:32:41 PST 2012


On 12/27/12, Walter Bright <newshound2 at digitalmars.com> wrote:
> Take a look at druntime\src\rt\dmain2.d. It catches all Throwable's and
> swallows
> them - it does not expect the C runtime to handle D exceptions. This is why
> Throwable is still catchable.

So then `nothrow` on the headers isn't enough since it only guarantees
we're catching Exception types and letting Nothrow types through to
Windows functions. It sounds to me like we need even stricter
enforcement on the headers which the language doesn't provide right
now (in hindsight maybe 'nothrow' should have been called 'noexcept').

For example people have problems throwing on x64 in C++ inside a
WNDPROC: http://stackoverflow.com/questions/2631452/64bit-exceptions-in-wndproc-silently-fail

I wonder if D has the same problem if an Error or Throwable escapes a WNDPROC?


More information about the Digitalmars-d mailing list