News for hackers. Stuff that matters.
Re:My favourite C++ footgun by UncleMeat on Tuesday June 22, 2021 @10:28PM (#27600114)
The answer is yes. Compiler authors absolutely take advantage of these things for optimizations.

As for paranoia about undefined behavior? Compilers won't emit a program to call you a pizza or format your disk. There are risks, but those aren't real ones.

Re:My favourite C++ footgun by a_t48 on Wednesday June 23, 2021 @12:20PM (#27606266)
A bit of a nit - your storage driver could absolutely emit a program that formats your disk due to undefined behavior.
Re:My favourite C++ footgun by UncleMeat on Wednesday June 23, 2021 @01:37PM (#27607408)
If you already have a problem that contains instructions that are manipulating your disk in these sorts of ways then this is within some reason. But the usual hyper-concern about UB is that it'll take a program that otherwise does completely different things (imagine some CLI utility that just reads from stdin) and instead produce some maximally adversarial program that ruins your life. This ins't a real concern.
Re:My favourite C++ footgun by a_t48 on Wednesday June 23, 2021 @01:42PM (#27607482)
Agree :)