What is Nostr?
Wolf480pl /
npub1704…t88d
2025-02-14 18:12:14
in reply to nevent1q…qylu

Wolf480pl on Nostr: Piggo :verified_horse: compilers do stupid optimizations based on supposed UB all the ...

Piggo :verified_horse: (nprofile…q955) compilers do stupid optimizations based on supposed UB all the time.

And this particular code seems to compile correctly* today: https://godbolt.org/z/E5YccWc31

but I'm not asking if it compiles correctly* today.

I'm asking if the C standard requires the compiler to compile it correctly* or if it allows a stupid optimization.

*by "correctly" I mean preserving the null check before the dereference
Author Public Key
npub170403ynslsp4tn32j8tfhjn3cdq2pgut0jpnhrlcxl524gxf36pqput88d