Home | History | Annotate | Download | only in lint1
History log of /src/tests/usr.bin/xlint/lint1/msg_193.c
RevisionDateAuthorComments
 1.22  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.21  28-Mar-2023  rillig branches: 1.21.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.20  21-Feb-2023  rillig lint: fix null pointer dereference in invalid case expression
 1.19  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.18  16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.17  16-Jan-2022  rillig tests/lint: document why accidental double semicolons are hard to detect
 1.16  15-Jan-2022  rillig lint: warn about unreachable null statements

This warning flags the second semicolon of 'return;;' as being
unreachable. It does not warn about these superfluous semicolons in
general though.

Seen in usr.bin/make/bmake_malloc.c.
 1.15  15-Jan-2022  rillig tests/lint: demonstrate undetected double semicolon

In a statement-list like 'return 0;;', the second semicolon is a
separate, unreachable statement.
 1.14  15-Aug-2021  rillig tests/lint: correct interpretation of NOTREACHED

The branch is unconditionally taken, therefore any later code is
unreachable as well.
 1.13  15-Aug-2021  rillig tests/lint: test how NOTREACHED affects the unreachable warning

Inspired by lib/libedit/readline.c 1.159 from 2021-08-15.
 1.12  11-Jul-2021  rillig lint: add quotes around placeholders in message 23 and 232
 1.11  21-Mar-2021  rillig tests/lint: test reachability of goto and named labels
 1.10  21-Mar-2021  rillig tests/lint: add test for reachability of non-constant conditions
 1.9  21-Mar-2021  rillig tests/lint: add test for reachability of nested 'if' statements
 1.8  21-Mar-2021  rillig lint: warn about unreachable statement after joining the 'if' branches
 1.7  21-Mar-2021  rillig lint: fix reachability for while (0)
 1.6  21-Mar-2021  rillig lint: fix reachability for constant controlling expression in for loop
 1.5  21-Mar-2021  rillig lint: fix reachability for if-then-else statements
 1.4  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.3  21-Mar-2021  rillig tests/lint: add tests for reachability of statements

Right now, reachability is only implemented for loops, but not for
selection statements.
 1.2  30-Jan-2021  rillig lint: remove message 189, add tests for a few other messages

Message 189 would have applied to traditional C and was supposed to
detect assignments between struct and union types. The corresponding
check had never been implemented though.

Traditional C has been superseded for 30 years now, therefore there is no
point in adding this check retroactively.
 1.1  02-Jan-2021  rillig lint: add a test for each message produced by lint1

Having a test for each message ensures that upcoming refactorings don't
break the basic functionality. Adding the tests will also discover
previously unknown bugs in lint.

The tests ensure that every lint message can actually be triggered, and
they demonstrate how to do so. Having a separate file for each test
leaves enough space for documenting historical anecdotes, rationale or
edge cases, keeping them away from the source code.

The interesting details of this commit are in Makefile and
t_integration.sh. All other files are just auto-generated.

When running the tests as part of ATF, they are packed together as a
single test case. Conceptually, it would have been better to have each
test as a separate test case, but ATF quickly becomes very slow as soon
as a test program defines too many test cases, and 50 is already too
many. The time complexity is O(n^2), not O(n) as one would expect.
It's the same problem as in tests/usr.bin/make, which has over 300 test
cases as well.
 1.21.2.1  02-Aug-2025  perseant Sync with HEAD

RSS XML Feed