www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20689] New: dmd's -betterC mode generates "undefined


          Issue ID: 20689
           Summary: dmd's -betterC mode generates "undefined reference to
                    '_memsetFloat'" when using float arrays
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: cruz.dlang netsiteinnovations.com

The following program fails to link when using dmd versions 2.090.0 and 2.091.0
on linux:

import core.stdc.stdio;
extern (C) void main(int argc, char **argv)
    float[4] f;
    printf("f[0] = %f\n", f[0]);

Similar error is generated when using double arrays, but int and long arrays
work fine.  LDC's betterC mode does not generate errors with float or double
arrays.  Also, explicitly initializing f allows dmd to compile the program
without errors.

Mar 19 2020