-
Notifications
You must be signed in to change notification settings - Fork 26
Cannot perform pointer arithmetic in complex assignment #121
Comments
This is actually because of the |
We can't desugar this to int *a[10];
int main() {
int i;
*a = &i;
*a += 1;
} |
I mean ... we could desugar it and just violate the standard ... |
That doesn't work for function calls though: int x;
int *f() {
// mutates global state!
x += 5;
return &x;
}
int main() {
*f() += 5;
} |
Oh! I can just desugar to |
That involves a needless load and store though ... maybe I should finally implement the |
Even simpler: emit a declaration of the variable that gets sent to the backend, then |
I have a start on this in the compound-assignment branch, but it requires separating out parsing from semantic analysis. I've always meant to do this, it's just a little earlier than I planned. I think I'll make separate analysis a different branch and merge that before I merge compound assignment. |
Waiting on #151 |
The text was updated successfully, but these errors were encountered: