August 10, 2013
On 8/7/13, Johannes Pfau <nospam@example.com> wrote:
> http://dpaste.dzfl.pl/0f23146f
> There's no difference in the generated code, but this way the compiler
> will complain if you pass a non-nothrow function to
> glfwSetWindowCloseCallback.

Although this only stops Exception types from propagating. Error and Throwable will still be allowed to be thrown. I would find it dangerous if a C library ends up swallowing a Throwable and continues execution like nothing happened.
August 10, 2013
On 8/8/13, Walter Bright <newshound2@digitalmars.com> wrote:
> I agree that C callbacks called from C code should be nothrow.
>
> At a minimum, the C code that calls the callback is not going to be
> expecting an
> exit via exception, and so may leave things in an indeterminate state.

What about Error and Throwable? I think those shouldn't pass to the C code either. Unforunately 'nothrow' is a misnomer because it really means 'noexception', it allows both Error and Throwable to propagate from nothrow functions.
August 10, 2013
On 8/8/2013 2:27 PM, Andrej Mitrovic wrote:
> What about Error and Throwable? I think those shouldn't pass to the C
> code either. Unforunately 'nothrow' is a misnomer because it really
> means 'noexception', it allows both Error and Throwable to propagate
> from nothrow functions.


You're generally on your own with Error and Throwable going across foreign code.
1 2
Next ›   Last »