[Issue 12789] New: Add -transition=nan to emit floating-point variables default-initialized to NaN

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri May 23 06:51:51 PDT 2014


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 at gmail.com
          Reporter: andrej.mitrovich at 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.

--


More information about the Digitalmars-d-bugs mailing list