Comment

Comment by kccqzy

Clang and GCC have something like this but restricted to just comparisons, called -Wtautological-compare. I recommend turning it on for the same reasons. Although in practice it may need to be suppressed in macro-heavy or template-heavy code.

This has also caught many real world bugs in C such as https://github.com/aircrack-ng/rtl8812au/issues/308

parent kccqzy 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton