[Issue 21666] New: wrong printf format specifier for `real` with -checkaction=context on Win64
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Feb 27 15:25:33 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=21666
Issue ID: 21666
Summary: wrong printf format specifier for `real` with
-checkaction=context on Win64
Product: D
Version: D2
Hardware: x86_64
OS: Windows
Status: NEW
Severity: normal
Priority: P1
Component: druntime
Assignee: nobody at puremagic.com
Reporter: dkorpel at live.nl
When compiling this code on Windows with dmd -m64 -checkaction=context:
```
void main() {
assert(real(0.0) == 0.0);
}
```
You get:
C:\D\dmd2\windows\bin\..\..\src\druntime\import\core\internal\dassert.d(186):
Deprecation: argument cast(__c_long_double)v for format specification "%Lg"
must be real, not double
Which points to this code in miniFormat():
```
import core.stdc.config : LD = c_long_double;
(...)
else static if (is(V == real))
len = sprintf(&val[0], "%Lg", cast(LD) v);
```
--
More information about the Digitalmars-d-bugs
mailing list