February 01, 2013 [dmd-internals] Static initialization from Struct literals | ||||
---|---|---|---|---|
| ||||
Attachments:
| Hi, I was fixing a bug in ldc while I noticed strange behavior in the dmd implementation. struct S { int array[4]; } void main() { S local = S(67); // local.array = [67, 67, 67, 67] static S static_ = S(67); // static_.array = [67, 0, 0, 0] assert(local == static_); } The assert fails both on current dmd and ldc. Since this is a shady mismatch, I filed a bug report http://d.puremagic.com/issues/show_bug.cgi?id=9425. However when checking the integrity of my commit, the testsuite failed at http://github.com/D-Programming-Language/dmd/blob/e7eff4deef0fb5ec9a89cee4716785832fc41fb9/test/runnable/test42.d#L3223 . Is this static/runtime initialization mismatch intended after all or should I submit a pull request? That would mean that those tests break for other d implementations though. Note that this currently blocks some dependant fixes to be submitted into ldc. Sebastian |
Copyright © 1999-2021 by the D Language Foundation