www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - Static initialization from Struct literals

reply "Sebastian Graf" <SebastianGraf t-online.de> writes:
Hi,

in my attempt to fix #265 
(http://github.com/ldc-developers/ldc/pull/275), I transitively 
had to fix other things related to static initialization of 
structs and arrays. Unfortunately, I hit a wall today when I 
thought I just had it. Consider:

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_);
}

This passes in my current ldc commit, but fails for the current 
releases of dmd and ldc2, with values as commented. I could have 
lived with a bug and filed a bug report 
http://d.puremagic.com/issues/show_bug.cgi?id=9425 , but was 
baffled again when the ldc build test suite failed at 
http://github.com/D-Programming-Language/dmd/blob/e7eff4deef0fb5ec9a89cee4716785832fc41fb9/test/runn
ble/test42.d#L3223. 
How should I proceed? Just try to unfix it as expected in that 
test case, wait for a fix or try another issue instead?
Jan 30 2013
parent "David Nadlinger" <see klickverbot.at> writes:
On Wednesday, 30 January 2013 at 21:21:37 UTC, Sebastian Graf 
wrote:
 http://d.puremagic.com/issues/show_bug.cgi?id=9425
 [...]
 How should I proceed? Just try to unfix it as expected in that 
 test case, wait for a fix or try another issue instead?
You might want to send a message to dmd-internals, asking for clarification on the intended behavior and noting that the issue blocks LDC development. This way, you'll hopefully get an answer quicker than by just hoping that the right people stumble over the issue soon. David
Jan 31 2013