Andrej Mitrovic wrote:
On 10/1/12, Piotr Szturmaj <[email protected]> wrote:
For example C binding writers may change:
extern(C) char* getstr();
to
extern(C) cstring getstr();
I don't think you can reliably do that because of semantics w.r.t.
passing parameters on the stack vs in registers based on whether a
type is a pointer or not. I've had this sort of bug when wrapping C++
where the C++ compiler was passing a parameter in one way but the D
compiler expected the parameters to be passed, simply because I tried
to be clever and fake a return type. See:
http://forum.dlang.org/thread/[email protected]#post-mailman.1557.1346690320.31962.d.gnu:40puremagic.com
I think that align(1) structs that wrap a single value should be treated
as its type. After all they have the same size and representation. I
don't know how this works now, though.