ImportC and nothrow/@nogc?
Walter Bright
newshound2 at digitalmars.com
Wed Aug 21 19:48:40 UTC 2024
On 8/20/2024 2:12 AM, Manu wrote:
> Exactly... these points are my precise assumption going in here.
> Also, considering the possibility that D code is called from C code via a
> function pointer; you have to wonder how the C code received a function pointer
> in the first place? If the C code is nothrow @nogc, then it would be impossible
> to supply a function pointer that was not also nothrow @nogc to the C code in
> the first place.
```
// D file:
extern (C) void daFunc() { throw new Exception(); }
```
```
// C file:
extern void daFunc();
void hahahahaha() { daFunc(); }
```
No function pointers required. The D <=> C interoperability goes both ways.
More information about the Digitalmars-d
mailing list