You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
andrewrk opened this issue
Dec 19, 2020
· 2 comments
Labels
acceptedThis proposal is planned.breakingImplementing this issue could cause existing code to no longer compile or have different behavior.proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.
Labeling as a bug because if this proposal is accepted I believe it will fix a bug, if this proposal is rejected then this issue will be the bug report for that behavior. The bug is that generic functions which accept slices/pointers get incorrectly generated with respect to alignment. See that linked issue comment above for more details.
The text was updated successfully, but these errors were encountered:
andrewrk
added
the
proposal
This issue suggests modifications. If it also has the "accepted" label then it is planned.
label
Dec 19, 2020
andrewrk
added
breaking
Implementing this issue could cause existing code to no longer compile or have different behavior.
bug
Observed behavior contradicts documented or intended behavior
miscompilation
The compiler reports success but produces semantically incorrect code.
labels
Dec 19, 2020
I did it intentionally but I think that may have been a bad idea. I'm pretty sure we should change the language spec to accept this proposal but I just want to put a bit of thought into @ptrCast because it would be nice to keep extra alignment when doing pointer casting.
andrewrk
removed
bug
Observed behavior contradicts documented or intended behavior
miscompilation
The compiler reports success but produces semantically incorrect code.
labels
Dec 20, 2020
aarvay
pushed a commit
to aarvay/zig
that referenced
this issue
Jan 4, 2021
acceptedThis proposal is planned.breakingImplementing this issue could cause existing code to no longer compile or have different behavior.proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.
Uh oh!
There was an error while loading. Please reload this page.
This outputs:
I believe this strange behavior is the cause of the bug that is surfacing in #7482 (comment)
The language should not ignore the programmer's type that they specify.
Related: #1106
Labeling as a bug because if this proposal is accepted I believe it will fix a bug, if this proposal is rejected then this issue will be the bug report for that behavior. The bug is that generic functions which accept slices/pointers get incorrectly generated with respect to alignment. See that linked issue comment above for more details.
The text was updated successfully, but these errors were encountered: