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

Issue 9394 - ABI for static arrays is outdated #262

Merged
merged 1 commit into from Feb 7, 2013
Merged

Conversation

9rnsr
Copy link
Contributor

@9rnsr 9rnsr commented Feb 7, 2013

http://d.puremagic.com/issues/show_bug.cgi?id=9394

Almost of "Reference Types" section is outdated in D2.

$(P Passing abc to functions results in these implicit conversions:)

---------
void func(int* p); // abc is converted to a pointer
Copy link

Choose a reason for hiding this comment

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

This is still true in D2, as is the code below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed. In current, static array value is implicitly converted to pointer or dynamic array type on function argument.
But it is a implicit conversion feature, and it does not directly related to ABI.

And static array to pointer conversion is already deprecated.
https://github.com/D-Programming-Language/dmd/blob/master/src/mtype.c#L55
https://github.com/D-Programming-Language/dmd/blob/master/src/mtype.c#L4050

So, to remove these lines is reasonable.

Copy link

Choose a reason for hiding this comment

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

When I asked about it in the newsgroup I didn't get replies from Walter/Andrei, but I do agree with the deprecation. Anyway this needs to be added to the deprecation page.

Copy link

Choose a reason for hiding this comment

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

Btw, you can use Currently when you want to say In current. People will understand you better this way. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, it has not been mentioned yet in http://dlang.org/deprecate .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your teaches.

Copy link
Member

Choose a reason for hiding this comment

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

Remove please.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Recent reported regression issue 9539 has been caused by the deprecated implicit conversion T[] to T_.
I think it's a good time to remove such conversions, both T[n] to T_ and T[] to T*, completely (I think it is necessary for the regression fix).
See dlang/dmd#1679 and related my bugzilla comment.

Almost of "Reference Types" section is outdated in D2.
@ghost
Copy link

ghost commented Feb 7, 2013

Ok LGTM.

alexrp added a commit that referenced this pull request Feb 7, 2013
Issue 9394 - ABI for static arrays is outdated
@alexrp alexrp merged commit 20152e4 into dlang:master Feb 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants