Valid C? int a[10], (*p)[9] = (void*)(a+1); (*p)[0] = 1;
-
-
Replying to @RichFelker
we haven't found any compiler that assumes a [0] element of array doesn't alias a [1] element of array if that's your concern.
1 reply 0 retweets 0 likes -
Replying to @volatile_void
The question is basically can an [M] array lvalue "alias" a length-M subrange of an [N] array? (M<N)
1 reply 0 retweets 0 likes -
Replying to @RichFelker
IMO no actual aliasing takes place because the _array_ is never accessed; it just decays to a pointer into big array.
1 reply 0 retweets 1 like
But what about (*p)[-1]? Might compilers (wrongly?) treat it as undefined?
8:59 AM - 18 Jul 2016
0 replies
0 retweets
0 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.