www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12789] New: Add -transition=nan to emit floating-point

https://issues.dlang.org/show_bug.cgi?id=12789

          Issue ID: 12789
           Summary: Add -transition=nan to emit floating-point variables
                    default-initialized to NaN
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: andrej.mitrovich gmail.com
          Reporter: andrej.mitrovich gmail.com

C and C++ do not use NaN, but instead zero-initialize floating-point variables
(e.g. in struct fields).

When porting or interfacing to such libraries it becomes very easy to forget
this and to have odd results at runtime due to D's use of
default-initialization to NaN. I propose introducing a -transition=nan flag
which will emit the location of all the floating-point variables which are
default-initialized to NaN.

--
May 23 2014