3 ms·
Wouldn't "underhanded code" there require some ability to control UB?
by zahlman 8mo ago
Wouldn't "underhanded code" there require some ability to control UB?
- TuxSH 8mo agoDoesn't need to be UB, you can write expressions like: "some_s8_var < some_u32_var" and people will be had. Note that is not the same as "some_s8_var < some_u8_var". -Wextra catches stuff like this, alas I know of a few people that think "-Wextra is evil" (even though annoying warnings can be selectively disabled)
- zahlman 8mo agoFair enough. Given that things like `if (uid = 0) {}` can become a privilege escalation in the right context, surely code that takes the opposite branch of what it looks like is also dangerous in the wrong hands. I still remember being expected to pass -Wpedantic (and probably also -Wextra) in university.