did you know: int foo() { int x[4] = { 0, 1, 2, 3 }; return *(x + 5 - 3); } is undefined behavior in C
-
-
Replying to @FioraAeterna
@FioraAeterna How is this surprising? x+5 is undefined.3 replies 0 retweets 0 likes -
Replying to @RichFelker
@RichFelker@FioraAeterna People think that C pointers map exactly to "hardware linear address" semantics, even if it's just a common choice1 reply 0 retweets 0 likes -
Replying to @pikhq
@pikhq@FioraAeterna Indeed, but if you want to consider the arithmetic well-defined then comparisons of the results are meaningless.1 reply 0 retweets 0 likes
@pikhq @FioraAeterna Then n>m but p+n<p+m is possible. It's cleaner and easier to specify that the arith is UB than that compar. is bogus.
10:15 AM - 4 Nov 2015
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.