News for hackers. Stuff that matters.
Re:Why I’m Using C by loup-vaillant on Saturday March 14, 2020 @01:28PM (#22576925)
Compiler writers are too hooked on loop optimisations now to give up on undefined signed overflow. I'm afraid the only clean fix is to augment the language with an actual `for` loop, with an immutable loop index and well defined start and finish values. Stuff like:

  for (size_t i : 0..10)     {} // Will go from 0 to 9 included.
  for (size_t i : 10..0, -1) {} // Will go from 10 to 1 included...
                                // ...or maybe from 9 to 0 included?
                                // Not sure which is best.

There are no comments on this comment yet.