nothrow in druntime win32 C bindings

Andrej Mitrovic andrej.mitrovich at gmail.com
Wed Dec 26 14:12:11 PST 2012


All contents in the core.sys.windows.windows module in 2.061 are
marked as nothrow.

nothrow means exceptions derived from the Exception class are not
allowed to propagate. In other words now that the WNDPROC function
pointer is expected to be nothrow you have to wrap any statements
which might throw Exception objects in a try/catch block.

SEH[1] is implemented in D for x86 (x64 not yet, but maybe some day),
therefore exceptions can propagate, and they do as this sample will
show you if you compile it with 2.060:
https://github.com/AndrejMitrovic/dmd/blob/662db08ce9dd27d2c79d04ab4ccea9823f6142a1/test/win32/testthrow.d#L23

Are there problems with the SEH implementation which forces us to use
nothrow on win32? If there are then this should be documented.


More information about the Digitalmars-d mailing list