|
|
|
|
|
by 1ris
1830 days ago
|
|
Then i think i was wrong. For me this looks like it _added_ a whole lot of UB and made the rules of object provenance way more complex. >The real problem is that C users have been lied to. I think the real problem is that the committee is creating a language that the users neither need nor understand. The users want a language where pointers are, in fact, just address. |
|
And pointers weren’t addresses before either. My favorite example of “pointers aren’t addresses” is this kind of code:
int a[…]; int b[…]; /* … */ a[i] = 0; b[j] = 1; return a[i];
Ignoring this discussion for a moment, wouldn’t you expect `return a[i];` to optimize to `return 0;` here? After all, `a` and `b` are disjoint arrays! I’m sure many would be disappointed if the compiler did not do that optimization, right?