[Issue 8887] static arrays passed by value in extern C/C++ functions should not compile

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Nov 7 08:25:46 PST 2014


https://issues.dlang.org/show_bug.cgi?id=8887

--- Comment #5 from Steven Schveighoffer <schveiguy at yahoo.com> ---
(In reply to Steven Schveighoffer from comment #4)
> (In reply to Dicebot from comment #3)
>  
> > However I don't like compilation failure here either. extern(C) functions
> > must comply to C ABI and thus pass static arrays by pointer even if normal D
> > functions do that by value.
> 
> Wouldn't ref work? It seems to work for me.

Sorry, I quoted the wrong part of your post, it should have been:

(In reply to Dicebot from comment #3)
> This is regression from D1 behaviour that makes all of our existing
> extern(C) bindings segfault when compiled with D2 compiler. Only workaroun
> possible to replace it with pointer arguments everywhere, losing important
> chunk of type safety in process.

--


More information about the Digitalmars-d-bugs mailing list