Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
rollcat
· 1y ago · 0 comments
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.
Comments
[–]
Denvercoder9
1y ago
The C++ standard doesn't forbid introducing side channels, so the answer to the question is yes.
[–]
rollcat
OP
1y ago
With all the UB, I wonder how did we manage to write any secure or safety-critical code at all.
[–]
konstantinua00
1y ago
this isn't UB, and any other language can do this optimization as well
even the one you cult over
[–]
wat10000
1y ago
In C++? We pretty much did not.