www.digitalmars.com         C & C++   DMDScript  

D.gnu - [Bug 115] New: Union literals as rvalues yields different values

Date: Sat, 5 Apr 2014 22:32:44 +0100
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"


            Bug ID: 115
           Summary: Union literals as rvalues yields different values
                    every run
    Classification: Unclassified
           Product: GDC
           Version: 4.8.x
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gdc
          Assignee: ibuclaw gdcproject.org
          Reporter: klas.bjorkqvist gmail.com

When running the following program:

import std.stdio;

union _f {
  float f;
  uint i;

void func(const uint x) {

void main() {
  float a = 123.0;
  const l = _f(a);

multiple times, the value printed for "_f(a).i" is different each time, and
appears mostly random when compared to the value of "l.i". 

 gdc a.d && ./a.out
1123418112 430703264
1123418112 3680514720
1123418112 2543067808 -- You are receiving this mail because: You are watching all bug changes.
Apr 05 2014