Skip to content

[std.math.traits] Add error message for DMD on Arm targeting X86#10996

Open
thewilsonator wants to merge 1 commit into
dlang:masterfrom
thewilsonator:m-arm-fp
Open

[std.math.traits] Add error message for DMD on Arm targeting X86#10996
thewilsonator wants to merge 1 commit into
dlang:masterfrom
thewilsonator:m-arm-fp

Conversation

@thewilsonator

Copy link
Copy Markdown
Contributor

On my Mac M1, by default DMD tries to target X86_64 (separate issue), real.sizeof == 16LU and real.mant_dig == 53.
Special case the error message I got so that other people have context.

@thewilsonator thewilsonator requested a review from ibuclaw as a code owner April 25, 2026 02:29
@dlang-bot

Copy link
Copy Markdown
Contributor

Thanks for your pull request and interest in making D better, @thewilsonator! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + phobos#10996"

@ibuclaw

ibuclaw commented Apr 25, 2026

Copy link
Copy Markdown
Member

Shouldn't this be dmd specific?

With gdc you can tweak real to be 64, 80, 96, or 128 on x86_64 and all are valid (the mantissa bits stay the same, the size is just padding)

@thewilsonator

Copy link
Copy Markdown
Contributor Author

Possibly, but phobos statically asserts for the size, so the fact you can change the size in GDC means nothing.

@ibuclaw

ibuclaw commented Apr 25, 2026

Copy link
Copy Markdown
Member

Ah wait, this is for double, not real precision. So you've hit an impossible configuration, fix should be in dmd only then, rather than phobos.

@ibuclaw

ibuclaw commented Apr 25, 2026

Copy link
Copy Markdown
Member

I don't think the library should be masking the compiler in an accepts-invalid situation.

@thewilsonator

Copy link
Copy Markdown
Contributor Author

This is not a masking, it is an additional diagnostic.

@rikkimax rikkimax left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Diagnostic messages are good things to have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants