digitalmars.D - array assign bug
- Kevin Watters <Kevin_member pathlink.com> Feb 03 2006
- Chris <Chris_member pathlink.com> Feb 03 2006
- Kevin Watters <Kevin_member pathlink.com> Feb 03 2006
- Dave <Dave_member pathlink.com> Feb 04 2006
- Kevin Watters <Kevin_member pathlink.com> Feb 04 2006
- Sean Kelly <sean f4.ca> Feb 04 2006
- Sean Kelly <sean f4.ca> Feb 04 2006
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?
Feb 03 2006
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?
Feb 03 2006
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?
Feb 03 2006
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?
Feb 04 2006
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?
Feb 04 2006
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?
Feb 04 2006
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?
Feb 04 2006








Sean Kelly <sean f4.ca>