Static struct assign

bearophile bearophileHUGS at lycos.com
Thu May 28 14:01:47 PDT 2009


DMD 1.026 used by Codepad used to give errors on this code:
http://codepad.org/QSE36vhJ

struct S { int x; }
void main() {
    S i = 5;
    printf("%d", i.x); // prints 0
}

But the current DMD/LDC give no compilation error and just print "0".
Is this a new bug in the front-end?

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list