• nybble41
    link
    fedilink
    arrow-up
    14
    ·
    1 year ago

    I’m fairly certain that last one is UB in C. The result of an assignment operator is not an lvalue, and even if it were it’s UB (at least in C99) to modify the stored value of an object more than once between two adjacent sequence points. It might work in C++, though.

    • Beanie
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      That was my first thought when trying to figure out what it did