Yesterday I wrote a C code that, for some values of the parameters, was just an obfuscated way of dereferencing the null pointer. GCC detected that and simply decided to generate the instruction UD (undefined instruction) on that execution path. It was fun to see the concept of “undefined behavior” taken so literally. 😋

Follow

@otini I didn’t know this instruction. Do you know if it is possible to ask GCC for emitting a warning when it generates it?

@lthms It would be strange if not, though I haven't looked into it.

Sign in to participate in the conversation
Mastodon

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!