www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3701] New: Incorrect initialisation of static arrays of floating-point values

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3701

           Summary: Incorrect initialisation of static arrays of
                    floating-point values
           Product: D
           Version: 2.038
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bugzilla kyllingen.net


--- Comment #0 from Lars T. Kyllingstad <bugzilla kyllingen.net> 2010-01-13
00:35:18 PST ---
Example code:

  import std.stdio;

  void main()
  {
      float[1] a;
      writeln(a[0]);

      double[1] b;
      writeln(b[0]);

      real[1] c;
      writeln(c[0]);
  }

One expects this program to print "nan" three times, instead it prints:

  0
  0
  3.35109e-4932

It doesn't matter how long the arrays are, all the elements have the same
value.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 13 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3701


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug yahoo.com.au


--- Comment #1 from Don <clugdbug yahoo.com.au> 2010-02-15 00:45:45 PST ---
Can someone confirm this? The code works correctly on Windows on 2.038 and
every other version I've tried.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 15 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3701



--- Comment #2 from Lars T. Kyllingstad <bugzilla kyllingen.net> 2010-02-15
01:28:56 PST ---
Well, I'll be...

Now I can't reproduce it either -- not even with DMD 2.039, which was the
version I was using when I reported the bug.

I swear, I tried this several times before I reported it, both on my regular
OS, 64-bit Linux, and in two virtual machines, 32-bit Linux and Windows XP. 
There was no bug on Windows, which is why I marked the report as
Linux-specific.

If nobody else can reproduce this it should just be closed.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 15 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3701


ggcoding gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ggcoding gmail.com


--- Comment #3 from ggcoding gmail.com 2010-02-15 12:00:44 PST ---
--With 32-bit Linux and dmd 2.040 it prints:
0
0
1.6749e-4932

--With 32-bit Linux and dmd 2.039 it prints:
nan
nan
nan

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 15 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3701


hsteoh quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hsteoh quickfur.ath.cx


--- Comment #4 from hsteoh quickfur.ath.cx 2012-02-15 12:03:57 PST ---
This bug appears to have been fixed in dmd 2.057 and gdc 4.6.2, both running on
Linux.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 15 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3701



--- Comment #5 from hsteoh quickfur.ath.cx 2012-02-15 12:04:55 PST ---
P.S. Oh, and I tested this on 64-bit; don't know the status of 32-bit.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 15 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3701



--- Comment #6 from Don <clugdbug yahoo.com.au> 2012-02-16 08:20:43 PST ---
(In reply to comment #4)
 This bug appears to have been fixed in dmd 2.057 and gdc 4.6.2, both running on
 Linux.
That doesn't mean anything unless you can reproduce it on an earlier DMD -- it seems to be very platform-specific. If you can reproduce the bug on DMD 2.040, that would be fantastic, then we could close this annoying bug. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 16 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3701



--- Comment #7 from hsteoh quickfur.ath.cx 2012-02-16 09:39:15 PST ---
Where can I get older versions of dmd?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 16 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3701


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs eml.cc


--- Comment #8 from bearophile_hugs eml.cc 2012-02-16 10:00:43 PST ---
(In reply to comment #7)
 Where can I get older versions of dmd?
Take a look at the changelog, the version numbers are links: http://www.dlang.org/changelog.html -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 16 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3701



--- Comment #9 from hsteoh quickfur.ath.cx 2012-02-16 10:39:08 PST ---
Hmph. I can't reproduce the problem on 2.039 and 2.040 either. :( Perhaps it's
specific to 32-bit platforms. I don't think I'll be able to do anything about
it unless I resurrect my old mobo. :)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 16 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3701


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME


--- Comment #10 from Don <clugdbug yahoo.com.au> 2012-05-31 09:23:05 PDT ---
Nobody has been able to reproduce this in the last two years.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 31 2012