Skip to content

Incorrect support of addresses of the beginning of of arrays #10

@Ced

Description

@Ced

Clan accepts such a code without complaining or providing a correct support:
for (i = ...)
for (j = ...) {
f(A[i][j]); // Reference to an array cell
f(A[i]); // Address of the first element of A[i], i.e., &A[i][0]
f(A); // Address of the first element of A, i.e., &A[0], equivalent to &A[0][0]
}
Clan shoud either report an error stating that accesses do not have the same dimensionality, or support it correctly with a conservative approach using local dimensions: A[i] can be translated to an access to the whole row (i.e. A[i][ld] with no constraint on the local dimension ld) while A can be translated to an access to the whole array (i.e. A[ld1][ld2] with no constraint on the local dimensions ld1 and ld2).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions