News for hackers. Stuff that matters.
Re:Int a = 5; a = a++ + ++a; a =? (2011) by thaumasiotes on Thursday May 14, 2026 @08:36PM (#48143059)
> Compilers will not refuse to compile the code, indeed the blog post we are all commenting on reports the results from a bunch of different compilers.

Yes, I see that. I just said they should refuse.

Re:Int a = 5; a = a++ + ++a; a =? (2011) by masklinn on Friday May 15, 2026 @01:48AM (#48144999)
Because this specific UB is static (not usually the case) both gcc and clang will flag it if Wsequence-point is enabled (and it is part of Wall) (technically the clang warning is Wunsequenced but aliased to the GCC version).

edit: apparently Wunsequenced is enabled by default so clang should warn you out of the box.