News for hackers. Stuff that matters.
Re:Three proposals for the C standard WG14 by vyodaiken on Thursday June 21, 2018 @10:53AM (#17365689)
is k = i+j valid C? Can it be translated sensibly to add i,j; jump on overflow to random; store k; ? How about sometimes omitting the jump to random and sometimes not?
Re:Three proposals for the C standard WG14 by geofft on Thursday June 21, 2018 @11:24AM (#17365982)
Signed integer overflow is undefined, so the only obligation is that the code operates correctly when signed integer overflow doesn't happen. So, yes all those options are permissible, because as far as the C standard specifies, it's "add i,j; if false jump to random; store k".

If you want to add a definition for signed integer overflow (as C++ is considering, see http://wg21.link/P0907r0 ) then it would be defined and the compiler would no longer get to consider "if signed overflow" and "if false" the same.

Re:Three proposals for the C standard WG14 by vyodaiken on Thursday June 21, 2018 @12:09PM (#17366411)
I 100% doubt that that Ritchie would have agreed. This is the existing interpretation of the standard, which is exactly what I propose to change. I believe the standard interpretation has strayed from both the language design and the objectives of the language.