8 ms·
The context here is a tool that has to handle everything, so you won't necessarily run into all of these in your run-of-the-mill project. However, the author d
by SloopJon 5y ago
The context here is a tool that has to handle everything, so you won't necessarily run into all of these in your run-of-the-mill project. However, the author does claim:
> The following examples were actually encountered either in real programs or are taken from the ISO C99 standard or from the GCC’s testcases.
I have definitely seen (and probably even written) show-off code in C++ and other languages, but when it comes to C, I feel like the tricky stuff tends to be borne of necessity. For example, I test a code base that requires some type punning. The last time I investigated this, there didn't seem to be consensus on how to do this without UB.
Signed overflow is another bugbear in C. Code that worked perfectly fine for over twenty years was suddenly at the center of mysterious bugs when a new version of GCC decided to exploit some UB.