Today's “this language is broken” courtesy of @ch3root
https://godbolt.org/g/H8d0I2
-
-
Replying to @volatile_void @ch3root
C11 §6.5.6p9 If the result is not representable in an object of that type, the behavior is undef http://imgur.com/uodUIam
2 replies 0 retweets 0 likes -
Replying to @shafikyaghmour
Except that in this example, the result is representable.
1 reply 0 retweets 0 likes -
Replying to @volatile_void
hmmm, indeed. Maybe it is related to this: https://gcc.gnu.org/ml/gcc/2011-08/msg00221.html …
2 replies 0 retweets 1 like -
Replying to @shafikyaghmour
yes, “GCC restricts … half of the address-space” but silently translates some C programs that break this limit to nonsense.
1 reply 0 retweets 0 likes -
Replying to @volatile_void @shafikyaghmour
ordinary programs would be made safe by malloc that returns 0 for arg≥2GiB on 32-bit, but GCC ships with Glibc which doesn't
1 reply 0 retweets 0 likes -
Replying to @volatile_void @shafikyaghmour
GCC does not "ship with glibc". GNU/Linux distros ship with glibc, but GCC is used plenty of other places.
1 reply 0 retweets 0 likes -
Oh that makes more sense. You're saying glibc is wrong/broken because GCC is the compiler they intend you to use...
-
-
Replying to @RichFelker
...yet glibc's malloc, etc. don't meet the contracts required by GCC (no objects > SIZE_MAX/2).
1 reply 0 retweets 1 like - 2 more replies
New conversation -
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.