www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

digitalmars.D - array assign bug

↑ ↓ ← Kevin Watters <Kevin_member pathlink.com> writes:
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
↑ ↓ Chris <Chris_member pathlink.com> writes:
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
↑ ↓ Kevin Watters <Kevin_member pathlink.com> writes:
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
↑ ↓ Dave <Dave_member pathlink.com> writes:
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
↑ ↓ Kevin Watters <Kevin_member pathlink.com> writes:
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> writes:
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> writes:
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