Create two files with these contents. File: test.c typedef struct { float r,g,b,a; } COLOR; COLOR makecol(float r, float g, float b, float a) { COLOR ret; ret.r = r; ret.g = g; ret.b = b; ret.a = a; return ret; } File: test.d import std.stdio; struct COLOR { float r,g,b,a; } extern (C) COLOR makecol(float r, float g, float b, float a); void main() { auto col = makecol(1, 0.5, 1, 0.5); writefln("%s, %s, %s, %s", col.r, col.g, col.b, col.a); } Now compile the whole mess and test: gcc -c test.c && ar -r test.a test.o dmd test.d test.a ./test The expected output is "1, 0.5, 1, 0.5" but actually it output something completely different ("0, 0, 0, 0" on my system). This happens with both dmd 2.054 and 1.069. Perhaps this bug is related to 5570?
This example now works with at least 2.084.1 and 2.088.0. Please confirm and close.
I can confirm that this is not reproducible.