Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
July 08, 2006 Initialization error in classes | ||||
---|---|---|---|---|
| ||||
import std.stdio; class Foo { float[4] array = 1.0; // current color int count = 10; } void main( char[][] args ) { Foo f = new Foo(); writefln("Foo count = %s", f.count ); } this prints 0(zero) on my machine: AMD Athlon 64 3200, 1 GB Ram, DMD 0.162 This bug was SUCH a PITA, in my program count was set to 1970169165. |
July 08, 2006 Re: Initialization error in classes | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Medlock | David Medlock wrote:
> import std.stdio;
>
> class Foo
> {
> float[4] array = 1.0; // current color
> int count = 10;
> }
>
> void main( char[][] args )
> {
> Foo f = new Foo();
> writefln("Foo count = %s", f.count );
> }
>
>
> this prints 0(zero) on my machine:
> AMD Athlon 64 3200, 1 GB Ram, DMD 0.162
>
> This bug was SUCH a PITA, in my program count was set to 1970169165.
Just confirmed this bug does NOT happen in 0.161
-DavidM
|
July 13, 2006 Re: Initialization error in classes | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Medlock | David Medlock wrote:
> David Medlock wrote:
>> import std.stdio;
>>
>> class Foo
>> {
>> float[4] array = 1.0; // current color
>> int count = 10;
>> }
>>
>> void main( char[][] args )
>> {
>> Foo f = new Foo();
>> writefln("Foo count = %s", f.count );
>> }
>>
>>
>> this prints 0(zero) on my machine:
>> AMD Athlon 64 3200, 1 GB Ram, DMD 0.162
>>
>> This bug was SUCH a PITA, in my program count was set to 1970169165.
>
> Just confirmed this bug does NOT happen in 0.161
I think it did, it just didn't show itself. Anyhow, the fix will go out in the next update.
|
July 14, 2006 Re: Initialization error in classes | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright wrote:
>
> I think it did, it just didn't show itself. Anyhow, the fix will go out in the next update.
Thanks, Walter.
|
August 15, 2006 Re: Initialization error in classes | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Medlock Attachments: | David Medlock schrieb am 2006-07-08: > David Medlock wrote: >> import std.stdio; >> >> class Foo >> { >> float[4] array = 1.0; // current color >> int count = 10; >> } >> >> void main( char[][] args ) >> { >> Foo f = new Foo(); >> writefln("Foo count = %s", f.count ); >> } >> >> >> this prints 0(zero) on my machine: >> AMD Athlon 64 3200, 1 GB Ram, DMD 0.162 >> >> This bug was SUCH a PITA, in my program count was set to 1970169165. > > Just confirmed this bug does NOT happen in 0.161 Added to DStress as http://dstress.kuehne.cn/run/o/odd_bug_06_A.d http://dstress.kuehne.cn/run/o/odd_bug_06_B.d Thomas |
Copyright © 1999-2021 by the D Language Foundation