r/computerscience • • May 15 '25

Discussion Most underground and unknown stuff

Which kind of knowledge you think is really underground and interesting, but usually nobody looks up?

35 Upvotes

22 comments sorted by

View all comments

Show parent comment

2

u/comrade_donkey May 15 '25 edited May 15 '25

That's probably not what that comment meant.

UB inhibits compiler optimizations. And people write UB in C/C++ without realizing it, all the time. Something as simple as having an addition that could overflow anywhere in your function body can be enough to trigger UB.

2

u/dkopgerpgdolfg May 16 '25

UB inhibits compiler optimizations.

Please explain what you mean with that.

2

u/comrade_donkey May 16 '25

You are right, my wording was poor. UB code can be deleted entirely. We could argue that this is the best possible optimization of all.