r/computerscience • u/lowiemelatonin • 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?
36
Upvotes
View all comments
Show parent comment
2
u/Aaron1924 May 16 '25
Clang tends to optimize code a lot more aggressively around UB compared to GCC, the following function for example is optimized to always return 2 by GCC, but Clang treats the return value as entirely undefined (godbolt)
Using GCC as a reference for what UB "should be ok" is not a good idea