www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20759] New: Invalid printf checks for long double on win64

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

          Issue ID: 20759
           Summary: Invalid printf checks for long double on win64
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: moonlightsentinel disroot.org

DMDs printf check does not handle C's long double properly on Win64 (which is
equivalent to D's double according to  e.g.
https://docs.microsoft.com/en-us/cpp/cpp/fundamental-types-cpp?view=vs-2015)

===========================================
import core.stdc.config : c_long_double;
import core.stdc.stdio : printf;

void main()
{
    // c_long_double is double on win64
    printf("%Lg", c_long_double.init);  // Invalid deprecation
    printf("%Lg", real.init);           // Silently accepted
}
===========================================

dmd -m64 printf.d         
printf.d(7): Deprecation: argument nan for format specification "%Lg" must be
real, not double

--
Apr 22 2020