Skip to content

fix Issue 5854 - Built-in array sort doesn't sort SysTime correctly#3670

Merged
WalterBright merged 3 commits intodlang:masterfrom
dcarp:fix5854
Jun 17, 2014
Merged

fix Issue 5854 - Built-in array sort doesn't sort SysTime correctly#3670
WalterBright merged 3 commits intodlang:masterfrom
dcarp:fix5854

Conversation

@dcarp
Copy link
Contributor

@dcarp dcarp commented Jun 15, 2014

When creating the adaption of int opCmp(in S other) const to be called as int opCmp(ref const S other) const the compare parameters need to be reversed, otherwise array.sort will sort descending.

@Safety0ff
Copy link
Contributor

Link: https://issues.dlang.org/show_bug.cgi?id=5854
It needs a unittest.

@dcarp
Copy link
Contributor Author

dcarp commented Jun 16, 2014

The issue was about std.datetime module so the test was accordingly.
But probably is better to not depend on phobos.
I changed your example a little to not test one against the other.

@yebblies
Copy link
Contributor

But probably is better to not depend on phobos.

This is a requirement for new tests

@dcarp
Copy link
Contributor Author

dcarp commented Jun 16, 2014

How do I get the auto-tester verify this PR?

@Safety0ff
Copy link
Contributor

How do I get the auto-tester verify this PR?

Somebody with access needs to white list you AFAIK.

@yebblies
Copy link
Contributor

How do I get the auto-tester verify this PR?

I've added you to the whitelist.

@dcarp
Copy link
Contributor Author

dcarp commented Jun 17, 2014

I've added you to the whitelist.

Thank you!

@WalterBright
Copy link
Member

Auto-merge toggled on

WalterBright added a commit that referenced this pull request Jun 17, 2014
fix Issue 5854 - Built-in array sort doesn't sort SysTime correctly
@WalterBright WalterBright merged commit 539db52 into dlang:master Jun 17, 2014
@ibuclaw
Copy link
Member

ibuclaw commented Nov 15, 2014

This seems to have broken on GDC (we pass arguments in reverse to DMD) - probably related to a recent thread on the NG too.

@ibuclaw
Copy link
Member

ibuclaw commented Nov 15, 2014

we pass arguments in reverse to DMD

That is to say, GDC passes them in the right order, DMD passes them in reverse. :o)

kinke added a commit to kinke/ldc that referenced this pull request Oct 21, 2015
It's somehow crucially affected by the params order imposed by the ABI
(being a static D function).

Such totally not ABI-agnostic code should most likely not be in the
front-end, certainly not when auto-generating functions there.
See dlang/dmd#3670, it caused
problems for GDC too.

This hack will only work for x86_64, all other platforms will most likely
get a reversed ordering.
ibuclaw pushed a commit to ibuclaw/dmd that referenced this pull request Jul 10, 2022
Add __builtins.d to be imported by ImportC modules
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.

5 participants