Skip to content
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

fix Issue 20688 - Wrong code when linking to C complex number functions #11710

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

WalterBright
Copy link
Member

Settle dispute over whether it works or not :-)

@dlang-bot
Copy link
Contributor

dlang-bot commented Sep 7, 2020

Thanks for your pull request, @WalterBright!

Bugzilla references

Auto-close Bugzilla Severity Description
20688 major Wrong code when linking to C complex number functions

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 + dmd#11710"

cdouble r = cpowf(2. + 0i, 2. + 0i);
assert(cast(double)creal(r) == 4.0);
assert(cast(double)cimag(r) == 0.0);
printf("%f+%fi\n", cast(double)creal(r), cast(double)cimag(r));
Copy link
Member

Choose a reason for hiding this comment

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

You can use RUN_OUTPUT to check the output for correctness.

Copy link
Member

Choose a reason for hiding this comment

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

Or remove the printf as we're already covered by asserts?

Copy link
Member Author

Choose a reason for hiding this comment

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

The printf is nice to save typing when it doesn't work.

@ibuclaw
Copy link
Member

ibuclaw commented May 30, 2021

Didn't l fix this months ago?

@WalterBright
Copy link
Member Author

Didn't l fix this months ago?

I don't see how, as it is failing on some platforms!

@ibuclaw
Copy link
Member

ibuclaw commented May 30, 2021

See #12073, which tests all complex types on all extern linkages.

@ibuclaw
Copy link
Member

ibuclaw commented May 30, 2021

Ahh, you're testing Windows. I didn't think that they had complex types.

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.

4 participants