3 ms·
My understanding is that with this change, static analyzers have three options: 1. False positive on code that would have been an issue previously 2. False ne
by hatthew 2y ago
My understanding is that with this change, static analyzers have three options:
1. False positive on code that would have been an issue previously
2. False negative on a ton of similar footguns
3. Add complexity to differentiate between these cases
None of these options are fun.
- nitwit005 2y agoYes, but that tradeoff exists for most things those tools do. If you can easily and perfectly detect an error, it should just go into the compiler (and perhaps language spec).
- Dylan16807 2y ago> If you can easily and perfectly detect an error, it should just go into the compiler (and perhaps language spec). Nobody seems to care much about removing UB even when it's super easy. For example, a bunch of basic syntax errors like forgetting the closing quote on a string or not having a newline at the end of the file are UB.
- Chaosvex 2y agoI know this is a discussion about C but I'll add that C++ removed the newline requirement.