News for hackers. Stuff that matters.
Re:My favourite C++ footgun by atq2119 on Wednesday June 23, 2021 @04:57AM (#27602341)
This is the correct answer, plus add loop unrolling etc.

It is simply not possible to write an optimizing compiler in which the evaluation order is truly indeterminate yet always the same.

Re:My favourite C++ footgun by tsimionescu on Wednesday June 23, 2021 @05:52AM (#27602646)
I was claiming it could be left implementation defined instead of unspecified. That way, code for particular platforms could be evaluated in different order, but it would always be deterministic for a particular compiler.
Re:My favourite C++ footgun by vnorilo on Wednesday June 23, 2021 @06:34AM (#27602896)
The optimized evaluation order would depend on the situation near at the call site, not the architecture or platform.
Re:My favourite C++ footgun by tsimionescu on Wednesday June 23, 2021 @07:18AM (#27603148)
The GP that my post was replying to was claiming it was arch dependent, and I was pointing out that, if it had been, they would have likely not left it unspecified. So, I think you and I are in agreement.