this post was submitted on 17 Oct 2024
1368 points (98.9% liked)
RetroGaming
19795 readers
439 users here now
Vintage gaming community.
Rules:
- Be kind.
- No spam or soliciting for money.
- No racism or other bigotry allowed.
- Obviously nothing illegal.
If you see these please report them.
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I recently came across a rust book on how pointers aren't just ints, because of UB.
This may either: not print anything, print 3 or print 2.
Depending on the compiler, since b isn't changed at all, it might optimize the print for
print(2)
instead ofprint(b)
. Even though everyone can agree that it should either not print anything or 3, but never 2.