Hacker News new | ask | show | jobs
by rollcat 381 days ago
An unexpected optimisation can introduce a side channel (most commonly timing). This one would be safe, but "how do you tell a compiler which ones [not] to use" is a whole topic by itself.
1 comments

The C++ standard doesn't forbid introducing side channels, so the answer to the question is yes.
With all the UB, I wonder how did we manage to write any secure or safety-critical code at all.
this isn't UB, and any other language can do this optimization as well

even the one you cult over

In C++? We pretty much did not.