Comment #0 by verylonglogin.reg — 2014-05-08T08:48:43Z
It's a bad idea to throw exceptions across language boundaries as there is no guarantee a C standard library doesn't use its own exception handler for some reason. So `_compare_fp_t` should be `nothrow`.
Causing pull:
https://github.com/D-Programming-Language/druntime/pull/779
Comment #1 by bugzilla — 2014-05-09T09:22:27Z
This is deliberate. The reason is to not break existing code. People shouldn't have to go back and annotate code with 'nothrow' that was already working.
Comment #2 by verylonglogin.reg — 2014-05-09T09:46:08Z
(In reply to Walter Bright from comment #1)
> This is deliberate. The reason is to not break existing code. People
> shouldn't have to go back and annotate code with 'nothrow' that was already
> working.
But this code isn't "working". It's wrong and is a source of heisenbugs like every other code throwing exceptions across language boundaries. I see no excuse to have incorrect C library bindings and thus force D users to pay on-going cost of fixing heisenbugs because of it.
And yes, it isn't a regression.
(In reply to Martin Nowak from comment #3)
> (In reply to Walter Bright from comment #1)
> > This is deliberate. The reason is to not break existing code. People
> > shouldn't have to go back and annotate code with 'nothrow' that was already
> > working.
>
> Those callbacks were annotated nothrow 4 years ago so the code breaking
> argument doesn't make sense.
> https://github.com/WalterBright/druntime/commit/
> 370ffd8d6da3978f742fd17572b418aaf85db355
Sorry for the noise, global attributes do not affect function types in function signatures, so you were right about the code breakage.
Comment #5 by robert.schadek — 2024-12-07T13:33:49Z