On Mon, Mar 13, 2023, 04:26 John Cowan <cowan@ccil.org> wrote:


On Sun, Mar 12, 2023 at 7:40 AM Dan Cross <crossd@gmail.com> wrote:
 
It is certainly a shame that modern compiler writers have become essentially hostile to programmers in their pursuit of ever more aggressive optimizations based on rigid readings of the standard, common sense be damned.

Not at all.  It is clear that mainstream C and C++ compilers optimize for the features most important to mainstream C and C++ programmers, which are:

1) Execution speed.

2) Execution speed.

3) I lied; there is no 3.

If those are not your priorities, use a non-mainstream compiler or a different programming language.

Or you can ask GCC to respect your view of the language with things like -fno-strict-aliasing, -fwrapv, and -fno-trapv.