Up to [cvs.NetBSD.org] / src / tests / usr.bin / xlint / lint1
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
tests/lint: remove .exp files, as they have become redundant Now that each lint1 test lists all generated diagnostics as 'expect' comments, the information from the .exp files is no longer needed. The only information that gets lost is the order of the diagnostics, which is mostly relevant for paired messages like 'inconsistent definition' + 'previous definition was here'.
lint: in strict bool mode, continue after error message If a controlling expression is not of type bool but of any other scalar type, keep the expression. Its value is still useful for control flow analysis. This prevents an assertion failure when running lint on the generated scan.c, which contains a "while (1)" that does not stem from a system header. If it did, lint would accept it, see tn_from_system_header. But "scan.c" is not considered a system header. Maybe lint's definition of a system header needs to be revisited. After fixing this, there is another assertion failure though, so scan.c is not yet ready to be inspected by lint.
lint: prefix error messages with 'error:' This makes it easier to find these errors in the build logs.
lint: fix reachability computation in if statements Previously, only loop statements were considered for reachability. This ignored the possibility of an early return in an if statement, or unreachable branches.
lint: in strict bool mode, integer constants do not have type bool Previously, lint1 allowed integer constants such as 0 and 1 to be used as bool constants. This was only half-baked since after fixing all error messages from that strict mode, there may still be integer literals in the code that should be replaced with true or false. This would stop a migration from int to bool in the middle, leaving inconsistent code around. To find the remaining type inconsistencies, treat integers and bool as completely incompatible, even for compile time constants.
lint: add tests for newly added messages for strict bool mode