-
-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Win64] real constants parsed as 0 #761
Comments
Looks like hexadecimal strings are only supported in VS14: |
Didn't somebody pull the related code out of the MinGW CRT so we could use it? (@kinke maybe?) |
I didn't. We've previously used DMD/DMC's strtold() implementation back when real was 80 bits; we'd now actually need a C99-compliant strtod() for real == double. Imho, the best course of action is to continue using MSVC's strtold() but to require MSVC 2014+ as soon as it's released. It simply represents a big leap in terms of portability with its C99 conformance, as the linked MSDN blog shows. |
Even then we need to add a warning at least. It can't just silently use 0.0 |
How would invalid float literals be relevant here? |
Just wondering if they do error checking on the strtold call or inside. |
Invalid literals shouldn't even make it to the strtold call in the lexer. |
Makes sense. |
The compiler part is hopefully fixed with commit 2fdd4fe. |
FWIW, although we only support VS 2015+ anymore, this is fixed by #2054. |
Lexer::inreal calls Port::strtold to parse the real constants in std.math.
This maps to the msvc strtold and just returns 0, also see #747.
The text was updated successfully, but these errors were encountered: