Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Issue 9394 - ABI for static arrays is outdated #262

Merged
merged 1 commit into from

4 participants

@9rnsr
Collaborator

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

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

@AndrejMitrovic AndrejMitrovic commented on the diff
@@ -203,22 +203,6 @@ $(SECTION3 Reference Types,
referred to by reference; this means that class instances can never reside on the stack
or be passed as function parameters.
)
-
- $(P When passing a static array to a function, the result, although declared as a static array, will
- actually be a reference to a static array. For example:
- )
-
----------
-int[3] abc;
----------
-
- $(P Passing abc to functions results in these implicit conversions:)
-
----------
-void func(int* p); // abc is converted to a pointer
@AndrejMitrovic Collaborator

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

@9rnsr Collaborator
9rnsr added a note

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.

@AndrejMitrovic Collaborator

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.

@AndrejMitrovic Collaborator

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

@9rnsr Collaborator
9rnsr added a note

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

@9rnsr Collaborator
9rnsr added a note

Thanks for your teaches.

@andralex Owner
andralex added a note

Remove please.

@9rnsr Collaborator
9rnsr added a note

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 D-Programming-Language/dmd#1679 and related my bugzilla comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@9rnsr 9rnsr fix Issue 9394 - ABI for static arrays is outdated
Almost of "Reference Types" section is outdated in D2.
a6324ef
@AndrejMitrovic
Collaborator

Ok LGTM.

@alexrp alexrp merged commit 20152e4 into from
@ghost Unknown referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@ghost Unknown referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@ghost Unknown referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@ghost Unknown referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 7, 2013
  1. @9rnsr

    fix Issue 9394 - ABI for static arrays is outdated

    9rnsr authored
    Almost of "Reference Types" section is outdated in D2.
This page is out of date. Refresh to see the latest.
Showing with 0 additions and 16 deletions.
  1. +0 −16 abi.dd
View
16 abi.dd
@@ -203,22 +203,6 @@ $(SECTION3 Reference Types,
referred to by reference; this means that class instances can never reside on the stack
or be passed as function parameters.
)
-
- $(P When passing a static array to a function, the result, although declared as a static array, will
- actually be a reference to a static array. For example:
- )
-
----------
-int[3] abc;
----------
-
- $(P Passing abc to functions results in these implicit conversions:)
-
----------
-void func(int* p); // abc is converted to a pointer
@AndrejMitrovic Collaborator

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

@9rnsr Collaborator
9rnsr added a note

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.

@AndrejMitrovic Collaborator

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.

@AndrejMitrovic Collaborator

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

@9rnsr Collaborator
9rnsr added a note

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

@9rnsr Collaborator
9rnsr added a note

Thanks for your teaches.

@andralex Owner
andralex added a note

Remove please.

@9rnsr Collaborator
9rnsr added a note

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 D-Programming-Language/dmd#1679 and related my bugzilla comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
- // to the first element
-void func(int[] array); // abc is converted to a dynamic array
----------
)
Something went wrong with that request. Please try again.