Skip to content

fix #17952 - Invalid printf checks for long double on windows - #23733

Merged
thewilsonator merged 2 commits into
dlang:masterfrom
rainers:issue17952
Aug 28, 2026
Merged

fix #17952 - Invalid printf checks for long double on windows#23733
thewilsonator merged 2 commits into
dlang:masterfrom
rainers:issue17952

Conversation

@rainers

@rainers rainers commented Aug 28, 2026

Copy link
Copy Markdown
Member

The MS runtime doesn't support real if it is larger than double.

Is there a better option for portable code than to always use cast(c_long_double) for reals?

FYI: @denizzzka

The MS runtime doesn't support real if larger than double.
@rainers

rainers commented Aug 28, 2026

Copy link
Copy Markdown
Member Author

LDC will probably have to tweak the tests a bit, because it has real == double. There is no condition "windows but not LDC" for text replacement, though.

@denizzzka

denizzzka commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Paranoidal: maybe identity of real and double types would be better to check as:

version(Windows)
{
       bool isRealIdenticalToDouble = (
            real.mant_dig == double.mant_dig
            && real.min_exp == double.min_exp
            && real.max_exp == double.max_exp
        )
}

?

@rainers

rainers commented Aug 28, 2026

Copy link
Copy Markdown
Member Author

Paranoidal: maybe identity of real and double types would be better to check as:

That would test the host compiler, not the target to build for. The current target information is not that detailed.

@thewilsonator
thewilsonator merged commit 1906158 into dlang:master Aug 28, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants