‹ BackHN Continuity

Thread

C++26: Trivial infinite loops are no longer undefined behaviour

173 points · 290 comments · ibobev

  1. ErikCorry · · focus · HN ↗
    > [The C rule was rejected for C++ because it] could inhibit useful optimizations

    If be curious if these are the sorts of optimizations I would find useful to the point where I would be happy to pay the price of this annoying new behaviour.

    Or are they just the sorts of optimizations that a compiler writer finds useful who is engaged in a multi year career-defining pissing contest with a competing team?

    Don't get me wrong, I have myself engaged in a multi year career-defining pissing contest with a competing team. It's fun. But let's not kid ourselves that it's for the users' sake.

    1. rcxdude · · focus · HN ↗
      The bizarre thing is that the C rule is pretty deliberately narrowly scoped to still enable those optimizations, and the new C++ definition pretty much follows it except for this extra bit they tagged on that no-one was asking for.
    2. cryptonector · · focus · HN ↗
      They are not useful enough for this, no.
    3. cryptonector · · focus · HN ↗
      Repeal the compiler optimizer dev employment act.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.