27 ms·
But the compiler could just as well emit a warning "useless NULL comparison" instead of blithely assuming that the programmer intentionally wrote a book express
by tamana 11y ago
But the compiler could just as well emit a warning "useless NULL comparison" instead of blithely assuming that the programmer intentionally wrote a book expression. That wouldn't handle every case of UB, but would handle many.
- superuser2 11y agoA warning on removed dead code isn't helpful because dead come is legitimately removed all the time. No one would ever heed it.
- slavik81 11y agoIf you ignored dead code produced by macros and limited the check to function-scope, I think you'd mostly eliminate false positives.