3 ms·
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"
by rollcat 1y 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.
- Denvercoder9 1y agoThe C++ standard doesn't forbid introducing side channels, so the answer to the question is yes.
- rollcat 1y agoWith all the UB, I wonder how did we manage to write any secure or safety-critical code at all.
- wat10000 1y agoIn C++? We pretty much did not.
- konstantinua00 1y agothis isn't UB, and any other language can do this optimization as well even the one you cult over