Bug 20972 – wrong real literals on windows

Status
NEW
Severity
blocker
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2020-06-24T15:21:25Z
Last change time
2024-12-13T19:09:40Z
Keywords
wrong-code
Assigned to
No Owner
Creator
Илья Ярошенко
See also
https://issues.dlang.org/show_bug.cgi?id=20951, https://issues.dlang.org/show_bug.cgi?id=5229
Moved to GitHub: dmd#19733 →

Comments

Comment #0 by ilyayaroshenko — 2020-06-24T15:21:25Z
real r = 36893488147419103229.0L; assert(r == 0x1FFFFFFFFFFFFFFFDp0L); Windows specific bug.
Comment #1 by bugzilla — 2020-08-09T02:00:58Z
This comes down to a problem with strtold() in the Digital Mars C compiler runtime. https://github.com/DigitalMars/dmc/blob/master/src/core/strtold.c I'm not sure where the problem in that function is.
Comment #2 by dlang-bot — 2020-08-11T20:18:07Z
@kinke updated dlang/dmd pull request #11387 "Fix Issue 20951 - Don't use excess precision when parsing single- and double-precision literals" mentioning this issue: - Use strtold_dm() instead of DMC strtold() for parsing real literals I.e., only when using a DMD host compiler *and* -m32. This is a preparation for a fix for issue #20972 - fixing strtold_dm() will fix parsed real literals on Windows in general (and not only when linking DMD against the MSVC runtime). https://github.com/dlang/dmd/pull/11387
Comment #3 by robert.schadek — 2024-12-13T19:09:40Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19733 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB