Thread overview | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
February 04, 2006 array assign bug | ||||
---|---|---|---|---|
| ||||
struct Thing { int[5] vals = 3; } void main() { Thing t, g; printf("%d %d\n", t.vals[0], g.vals[0]); } I get this output: 3 622879781 Is the compiler missing the array assignment on the second struct initialization? |
February 04, 2006 Re: array assign bug | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kevin Watters | In article <ds14nl$16h7$1@digitaldaemon.com>, Kevin Watters says... > >struct Thing { >int[5] vals = 3; >} > >void main() { >Thing t, g; > >printf("%d %d\n", t.vals[0], g.vals[0]); >} > >I get this output: 3 622879781 > >Is the compiler missing the array assignment on the second struct initialization? > > my output: 3 3 perhaps you aren't using the newest version of dmd.exe? |
February 04, 2006 Re: array assign bug | ||||
---|---|---|---|---|
| ||||
Posted in reply to Chris | Definitely using 0.145, with Ares though--but I'm sure that wouldn't be the problem. I ran into it while crafting a template vector class. Can anyone else reproduce this? In article <ds1d21$1bml$1@digitaldaemon.com>, Chris says... > >In article <ds14nl$16h7$1@digitaldaemon.com>, Kevin Watters says... >> >>struct Thing { >>int[5] vals = 3; >>} >> >>void main() { >>Thing t, g; >> >>printf("%d %d\n", t.vals[0], g.vals[0]); >>} >> >>I get this output: 3 622879781 >> >>Is the compiler missing the array assignment on the second struct initialization? >> >> > > >my output: > >3 3 > >perhaps you aren't using the newest version of dmd.exe? > > |
February 04, 2006 Re: array assign bug | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kevin Watters | 0.145 (phobos) on both Linux and Windows working Ok for me as well. Try it with phobos once just for kicks. In article <ds1ijd$1efp$1@digitaldaemon.com>, Kevin Watters says... > >Definitely using 0.145, with Ares though--but I'm sure that wouldn't be the problem. I ran into it while crafting a template vector class. > >Can anyone else reproduce this? > >In article <ds1d21$1bml$1@digitaldaemon.com>, Chris says... >> >>In article <ds14nl$16h7$1@digitaldaemon.com>, Kevin Watters says... >>> >>>struct Thing { >>>int[5] vals = 3; >>>} >>> >>>void main() { >>>Thing t, g; >>> >>>printf("%d %d\n", t.vals[0], g.vals[0]); >>>} >>> >>>I get this output: 3 622879781 >>> >>>Is the compiler missing the array assignment on the second struct initialization? >>> >>> >> >> >>my output: >> >>3 3 >> >>perhaps you aren't using the newest version of dmd.exe? >> >> > > |
February 04, 2006 Re: array assign bug | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dave | OK it did work with Phobos. So it's a definite bug in Ares. I'll post it in the dsource.org Ares form. Thanks for the help. In article <ds2dfh$23j1$1@digitaldaemon.com>, Dave says... > > >0.145 (phobos) on both Linux and Windows working Ok for me as well. Try it with phobos once just for kicks. > >In article <ds1ijd$1efp$1@digitaldaemon.com>, Kevin Watters says... >> >>Definitely using 0.145, with Ares though--but I'm sure that wouldn't be the problem. I ran into it while crafting a template vector class. >> >>Can anyone else reproduce this? >> >>In article <ds1d21$1bml$1@digitaldaemon.com>, Chris says... >>> >>>In article <ds14nl$16h7$1@digitaldaemon.com>, Kevin Watters says... >>>> >>>>struct Thing { >>>>int[5] vals = 3; >>>>} >>>> >>>>void main() { >>>>Thing t, g; >>>> >>>>printf("%d %d\n", t.vals[0], g.vals[0]); >>>>} >>>> >>>>I get this output: 3 622879781 >>>> >>>>Is the compiler missing the array assignment on the second struct initialization? >>>> >>>> >>> >>> >>>my output: >>> >>>3 3 >>> >>>perhaps you aren't using the newest version of dmd.exe? >>> >>> >> >> > > |
February 04, 2006 Re: array assign bug | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kevin Watters | Crazy. I'll look into it.
Sean
Kevin Watters wrote:
> OK it did work with Phobos.
>
> So it's a definite bug in Ares. I'll post it in the dsource.org Ares form.
>
> Thanks for the help.
>
> In article <ds2dfh$23j1$1@digitaldaemon.com>, Dave says...
>>
>> 0.145 (phobos) on both Linux and Windows working Ok for me as well. Try it with
>> phobos once just for kicks.
>>
>> In article <ds1ijd$1efp$1@digitaldaemon.com>, Kevin Watters says...
>>> Definitely using 0.145, with Ares though--but I'm sure that wouldn't be the
>>> problem. I ran into it while crafting a template vector class.
>>>
>>> Can anyone else reproduce this?
>>>
>>> In article <ds1d21$1bml$1@digitaldaemon.com>, Chris says...
>>>> In article <ds14nl$16h7$1@digitaldaemon.com>, Kevin Watters says...
>>>>> struct Thing {
>>>>> int[5] vals = 3;
>>>>> }
>>>>>
>>>>> void main() {
>>>>> Thing t, g;
>>>>>
>>>>> printf("%d %d\n", t.vals[0], g.vals[0]);
>>>>> }
>>>>>
>>>>> I get this output: 3 622879781
>>>>>
>>>>> Is the compiler missing the array assignment on the second struct
>>>>> initialization?
>>>>>
>>>>>
>>>>
>>>> my output:
>>>>
>>>> 3 3
>>>>
>>>> perhaps you aren't using the newest version of dmd.exe?
>>>>
>>>>
>>>
>>
>
>
|
February 04, 2006 Re: array assign bug | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sean Kelly | For what it's worth, I'm not seeing that error in my local build. So this should either be fixed in the latest Ares release or it will be fixed in the next--I've been working on the C headers a bit so it could be a change that hasn't been made public yet.
Sean
Sean Kelly wrote:
> Crazy. I'll look into it.
>
> Sean
>
> Kevin Watters wrote:
>> OK it did work with Phobos.
>>
>> So it's a definite bug in Ares. I'll post it in the dsource.org Ares form.
>>
>> Thanks for the help.
>>
>> In article <ds2dfh$23j1$1@digitaldaemon.com>, Dave says...
>>>
>>> 0.145 (phobos) on both Linux and Windows working Ok for me as well. Try it with
>>> phobos once just for kicks.
>>>
>>> In article <ds1ijd$1efp$1@digitaldaemon.com>, Kevin Watters says...
>>>> Definitely using 0.145, with Ares though--but I'm sure that wouldn't be the
>>>> problem. I ran into it while crafting a template vector class.
>>>>
>>>> Can anyone else reproduce this?
>>>>
>>>> In article <ds1d21$1bml$1@digitaldaemon.com>, Chris says...
>>>>> In article <ds14nl$16h7$1@digitaldaemon.com>, Kevin Watters says...
>>>>>> struct Thing {
>>>>>> int[5] vals = 3;
>>>>>> }
>>>>>>
>>>>>> void main() {
>>>>>> Thing t, g;
>>>>>>
>>>>>> printf("%d %d\n", t.vals[0], g.vals[0]);
>>>>>> }
>>>>>>
>>>>>> I get this output: 3 622879781
>>>>>>
>>>>>> Is the compiler missing the array assignment on the second struct
>>>>>> initialization?
>>>>>>
>>>>>>
>>>>>
>>>>> my output:
>>>>>
>>>>> 3 3
>>>>>
>>>>> perhaps you aren't using the newest version of dmd.exe?
>>>>>
>>>>>
>>>>
>>>
>>
>>
|
Copyright © 1999-2021 by the D Language Foundation