History log of /src/tests/usr.bin/xlint/lint1/msg_333.c |
Revision | | Date | Author | Comments |
1.8 |
| 13-Nov-2024 |
rillig | lint: add more details to 'statement not reached' message
In lib/libcompat/regexp/regexp.c, the FAIL macro expands to a compound statement containing a function call statement and a return statement, and the macro invocation is followed by a semicolon, forming an extra empty statement. Which of these statements is unreachable now becomes clear from the diagnostic, without having to inspect the preprocessed source code.
|
1.7 |
| 07-Jul-2023 |
rillig | branches: 1.7.2; lint: warn about function definitions without header declaration
The existing warning was only issued for function declarations, not for function definitions.
The interesting change in the tests is in msg_351.c. Many other tests use non-static functions due to their syntactic brevity. In these tests, the warning is disabled individually, to allow new functions to be added without generating warning 351.
|
1.6 |
| 11-May-2023 |
rillig | lint: fix type name in diagnostic for enum as controlling expression
Previously, the type was reported as 'int' instead of 'enum'.
Continue to only report the type simple for pointer types, as the exact pointer type is irrelevant to this message.
|
1.5 |
| 17-Jun-2022 |
rillig | tests/lint: make 'expect+-' comments stricter
Previously, the expectations from these comments were already satisfied if the expectation occurred somewhere in the actual message from lint. This meant that the prefix 'error:' or 'warning:' could be omitted from the 'expect' comment. These omissions were hard to see in a manual review. Now any omissions must be visually marked with '...'.
The test msg_342 now reports its messages properly as being in the file msg_342.c, rather than msg_341.c. This had been a copy-and-paste mistake.
|
1.4 |
| 04-Jul-2021 |
rillig | 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.
|
1.3 |
| 21-Mar-2021 |
rillig | 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.
|
1.2 |
| 16-Jan-2021 |
rillig | 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.
|
1.1 |
| 14-Jan-2021 |
rillig | lint: add tests for newly added messages for strict bool mode
|
1.7.2.1 |
| 02-Aug-2025 |
perseant | Sync with HEAD
|