Home | History | Annotate | Download | only in lint1
History log of /src/tests/usr.bin/xlint/lint1/msg_135.c
RevisionDateAuthorComments
 1.17  21-Mar-2025  rillig lint: don't warn when a cast increases the alignment from 1 to n
 1.16  21-Mar-2025  rillig tests/lint: demonstrate questionable warning about alignment
 1.15  23-Apr-2023  rillig branches: 1.15.2;
tests/lint: add rationale for not warning about alignment problems
 1.14  22-Apr-2023  rillig lint: allow cast from a type to a union containing that type
 1.13  22-Apr-2023  rillig tests/lint: test cast to union with stricter alignment
 1.12  28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.11  16-Jul-2022  rillig lint: add more details to message about pointer alignment

The previous message 'may cause alignment problem' was not detailed
enough to be actionable, it didn't give the necessary insight to why
lint was complaining at all.

The new message 'increases alignment from 1 to 4' or 'from 2 to 8'
describes the potentially problematic conversion, and together with the
involved type names, it allows an informed decision about whether lint's
warning is warranted or not.

In a typical NetBSD build, this warning is in the top 10. The number of
these warnings depends on the architecture, it is typically between 800
and 1600.
 1.10  11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.9  15-Jul-2021  rillig lint: allow pointer casts from 'char *' and 'unsigned char *'

For the sake of traditional code that did not yet migrate to using 'void
*' for arbitrary pointers.

In the standard NetBSD build, this reduces the number of lint warnings
by around 7000, of 57000 total.
 1.8  15-Jul-2021  rillig tests/lint: demonstrate questionable warnings for pointer casts
 1.7  17-Apr-2021  rillig lint: do not warn about alignment when casting from incomplete struct

This removes a bunch of technically correct but practically useless
warnings from the regular NetBSD build.
 1.6  17-Apr-2021  rillig tests/lint: add test for pointer cast from incomplete struct
 1.5  28-Feb-2021  rillig tests/lint: force 'expect' annotations
 1.4  28-Feb-2021  rillig lint: add type information to 'possible pointer alignment problem [135]'

This warning occurs more than 7400 times in a regular NetBSD build, and
without giving any type information, leaves the reader clueless about
what the underlying issue might be. Add type information since that is
a no-brainer to implement.
 1.3  28-Feb-2021  rillig tests/lint: add test for 'possible pointer alignment problem [135]'
 1.2  21-Feb-2021  rillig lint: force each test to declare the expected diagnostics

By listing the expected diagnostics directly at the code that triggers
the diagnostics, it is easier to cross-check whether the diagnostics
make sense.

No functional change to lint itself.
 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.15.2.1  02-Aug-2025  perseant Sync with HEAD

RSS XML Feed