3 ms·
Except there is some very crazy code out there, and if you come across it and took at least one such quiz, you know you'll have to be careful.
by n_plus_1_acc 3y ago
Except there is some very crazy code out there, and if you come across it and took at least one such quiz, you know you'll have to be careful.
- mtlmtlmtlmtl 3y agoOh yeah, I've seen some shit, having done a fair bit of professional C work, mostly in the embed space. But if I'm in an existing codebase, and I see a certain volume of this kind of "potential UB everywhere" code, my first instinct isn't let's spend however long trying to understand what exactly this code may or may not be doing/relying on according to dusty corners of the standard and the datasheet(sometimes you may have to, but I find it's rare). I prefer to approach it as "what is this code supposed to do, and how can it be done more sanely? Usually I find I can replace the crazy code with sane code in a fraction of the time it would take to fully understand the crazy code.