Home | History | Annotate | only in /src/tests/usr.bin/xlint
History log of /src/tests/usr.bin/xlint
RevisionDateAuthorComments
 1.3 15-Jan-2023  rillig tests/lint: add basic tests for lint (not lint1 or lint2)
 1.2 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file Makefile was added on branch yamt-pagecache on 2012-04-17 00:09:22 +0000
 1.24 17-Jun-2022  rillig tests/lint: move check-expect.lua to tests/lint1

It is only used for testing lint1, not for lint2 or xlint.
 1.23 17-Jun-2022  rillig 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'.
 1.22 17-Jun-2022  rillig tests/lint: treat a missing .exp file like an empty one

Previously, a missing .exp file skipped all the checks, that is, the
tests wouldn't fail if there were some unexpected new message.
 1.21 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.20 17-Jun-2022  rillig tests/lint: rename local variables in check-expect.lua

Enough time has passed since I wrote that little program to make me
forget the naming scheme I had in mind back then. Prefix the variable
names with the source of their data, 'c_' or 'exp_', to provide a bit of
orientation.

No functional change.
 1.19 17-Jun-2022  rillig tests/lint: do not interpret 'expect:' comments, only 'expect+-n:'

Only the tests in msg_*.c had used the short form of the 'expect:'
comments. The other tests used the more detailed variant 'expect+n:' or
'expect-n:'.
 1.18 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.17 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.16 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.15 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.14 07-Dec-2021  rillig tests/lint: make error handling simpler

The previous form was better suited for integrated unit tests (as in
distrib/sets/fmt-list). These small validation programs are easy enough
to be tested from the command line though.
 1.13 05-Sep-2021  rillig tests/lint: document placement of lint comments
 1.12 21-Aug-2021  rillig tests/lint: suggest better quickfix for expected lint diagnostics

The /* expect */ comments are usually so detailed that they are placed
in a line of their own, referring to the following line.
 1.11 19-Aug-2021  rillig tests/lint: test folding of constant expressions

Since November 2001, there is a comment above the function 'fold' that
suggests there are a few bugs concerning overflow detection. Add some
first 'proper regression tests' to prove these bugs.
 1.10 05-Jul-2021  rillig tests/lint: fix check-expect.lua for empty .exp file

An absent .exp file is equivalent to an empty .exp file. In neither of
these cases must the corresponding .c file declare any expected
diagnostics.
 1.9 05-Jul-2021  rillig tests/lint: remove unused variables
 1.8 08-Apr-2021  rillig lint: in code from included files, print stack trace

Previously, the standard NetBSD build generated several lint warnings in
lhash.h from OpenSSL, without providing any hint as to which file
actually included that header. In cases like these, lint now interprets
the line number information in the preprocessor output from GCC to
reconstruct the exact include path to the file in question.

The program check-expect.lua had to be rewritten almost completely since
it assumed that all diagnostics would come from the main file. In all
existing tests, this was true, but these tests did not cover all cases
that occurred in practice. Now it records the complete location of the
diagnostic instead of just the line number.
 1.7 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.6 28-Feb-2021  rillig tests/lint: force 'expect' annotations
 1.5 27-Feb-2021  rillig tests/lint: allow 'expect' comments to refer to other lines

This allows /* expect+1: ... */ to refer to the following line, as well
as /* expect-1: ... */ to refer to the previous line. This avoids
horizontal scrolling to see the expectations, it also allows these
expectations comments to be more verbose, mentioning the whole
diagnostic in many cases.

The 'expect' comments don't need to be at the end of a line anymore
since that was rather surprising. The one 'expect' comment that had not
been at the end of the line was in d_c99_bool_strict.c and was not
intended to be ignored.
 1.4 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.3 20-Feb-2021  rillig lint: ensure that '# line' directives in tests are correct

It's too easy to forget one of them when adding or removing some lines.
This would make it more difficult to locate the lines referenced in the
error messages.
 1.2 16-Jan-2021  rillig lint: prepare to make strict bool mode even stricter

Currently, strict bool mode still allows integer constant expressions to
be converted implicitly to bool. This is something that other languages
such as Go, Java, C#, Pascal don't allow.

By providing a custom implementation of <stdbool.h> that defines false
and true to custom bool constant identifiers, lint will cover these
cases as well.

To prepare for this, reword the rules and restructure the tests in
d_c99_bool_strict.c.
 1.1 12-Jan-2021  rillig lint: add new check for strict bool mode

In strict bool mode, bool is considered incompatible with all other
scalar types, just as in Java, C#, Pascal.

The controlling expressions in if statements, while loops, for loops and
the '?:' operator must be of type bool. The logical operators work on
bool instead of int, the bitwise operators accept both integer and bool.
The arithmetic operators don't accept bool.

Since <stdbool.h> implements bool using C preprocessor macros instead of
predefining the identifiers "true" and "false", the integer constants 0
and 1 may be used in all contexts that require a bool expression.
Except from these, no implicit conversion between bool and scalar types
is allowed.

See usr.bin/tests/xlint/lint1/d_c99_bool_strict.c for more details.

The command line option -T has been chosen because all obvious choices
(-b or -B for bool, -s or -S for strict) are already in use. The -T may
stand for "types are checked strictly".

The default behavior of lint doesn't change. The strict bool check is
purely optional.

An example program for strict bool mode is usr.bin/make, which has been
using explicit comparisons such as p != NULL, ch != '\0' or n > 0 in
most places for a long time now, even before the refactoring in 2020.
 1.142 08-Jun-2024  rillig tests/lint: reorganize tests

Tests for a single working language construct don't usually need a
separate file, they can be grouped together, like in expr.c or gcc.c.
 1.141 23-Apr-2023  rillig tests/lint: test command line parsing for message and query IDs

The parsing methods differ but shouldn't.
 1.140 05-Feb-2023  rillig tests/lint: fix source directory for looking up the .exp-ln files
 1.139 05-Feb-2023  rillig tests/lint1: the redundantly listed files contained .exp-ln as well
 1.138 05-Feb-2023  rillig tests/lint: fix resolving of wildcards in builds from other directories
 1.137 05-Feb-2023  rillig tests/lint: remove redundancy from Makefile

The list of test files is already kept in distrib/sets/lists/tests/mi.
 1.136 05-Feb-2023  rillig tests/lint: remove redundant tests

The names of the tests were misleading: 'recursive' should have been
'nested', and the interesting topic in the 'cast' tests was not the cast
but the pointer dereference.
 1.135 29-Jan-2023  rillig tests/lint: merge tests for '>>'
 1.134 22-Jan-2023  rillig tests/lint: merge tests for declaration after statement
 1.133 21-Jan-2023  rillig lint: add support for the C11 type qualifier '_Atomic'

That keyword can be used as a type specifier as well, support for that
will be added later.
 1.132 21-Jan-2023  rillig tests/lint: test _Atomic, added in C11
 1.131 15-Jan-2023  rillig tests/lint: add test for parsing sizeof expressions
 1.130 04-Jan-2023  rillig tests/lint: merge tests for ':?' with null pointer constant
 1.129 05-Jul-2022  rillig lint: add additional queries that are not enabled by default

In the last 18 months, several lint warnings have been made adjusted to
allow common usage patterns. For example, lint no longer warns about a
constant condition in the statement 'do { ... } while (false)' (message
161), as this pattern is well-known in statement-like macros, making it
unlikely that the 'false' is a mistake. Another example is casts
between unequal pointer types (message 247) for a few well-known
patterns that are unlikely to be bugs.

Occasionally, it is useful to query the code for patterns or events that
would not justify a warning. These patterns are modeled as predefined
queries that can be selected individually, in addition to and
independently of the existing warnings and errors.

New queries can be added as needed, in the same way as new warnings.
Queries that are deemed no longer used can be deactivated in the same
way as warnings that are no longer used.

As long as none of the queries is enabled, they produce a minimal
overhead of querying a single global variable. Computations that are
more expensive than a few machine instructions should be guarded by
any_query_enabled.

https://mail-index.netbsd.org/source-changes-d/2022/06/28/msg013716.html

ok christos@
 1.128 17-Jun-2022  rillig tests/lint: move check-expect.lua to tests/lint1

It is only used for testing lint1, not for lint2 or xlint.
 1.127 17-Jun-2022  rillig 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'.
 1.126 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.125 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.124 10-Jun-2022  rillig tests/lint: fix test for loss of accuracy on ILP32 platforms

The test had been wrong since msg_132.c 1.14 from 2022-05-30.

Using 'unsigned long' in a test that was intended to behave the same on
ILP32 and LP64 was an accident. Use 'unsigned long long' instead, which
is 64-bits wide on all platforms supported by lint.

Move the test about conversion from 'long' to 'int' to the
platform-specific test files.

Noticed by martin@ on powerpc.
 1.123 12-May-2022  rillig tests/lint: add more tests for __alignof__
 1.122 12-May-2022  rillig tests/lint: adjust tests to reflect missing support of __alignof__

The change in lex.c 1.129 attempted to add support for __alignof, in
addition to the existing support for __alignof__. It failed by removing
support for __alignof__, while allowing the plain 'alignof' instead.
 1.121 28-Apr-2022  rillig lint: revert resolving grammar conflicts for labeled statements

Restore the grammar rule for labeled_statement as it was before cgram.y
1.400 from 2022-04-24. This allows labels with attributes again. Fix
the wrong interpretation in the tests; the attributes belong to the
label, not to the statement.

Today in the morning, when I thought that the change in cgram.y 1.400
were innocent, I accidentally ran lint only with the options '-Sw' but
forgot the option '-g' for GNU mode. Without that option, the token
'__attribute__' is unknown, which unsurprisingly leads to lots of syntax
errors, and these didn't change with that commit. The actual change was
only visible in GNU mode.
 1.120 16-Apr-2022  rillig lint: fix instructions for adding a new test
 1.119 08-Apr-2022  rillig lint: remove unused message 70, add some more tests
 1.118 05-Apr-2022  rillig tests/lint: add tests for a few early messages
 1.117 20-Dec-2021  rillig tests/lint: test excess braces around initializers
 1.116 16-Dec-2021  rillig tests/lint: remove generated shell program on 'make clean'
 1.115 06-Dec-2021  rillig tests/lint: demonstrate wrong warning for __builtin_alloca
 1.114 30-Oct-2021  rillig lint: warn if an enum name is used for mismatched array access

This helps to keep the enum definition and the straight-forward
implementation of a to_string or name function in sync.

The test for message 241 had to be adjusted because of exactly this bug.
That test defined a bit mask enum but accessed it like a value enum
type.
 1.113 26-Sep-2021  rillig tests/lint: add tests for platform characteristics

Running lint in usr.bin/make on i386 fails due to this warning:

cond.c(800): warning: argument #3 is converted from 'unsigned char' to
'unsigned int' due to prototype [259]

This warning only occurred on i386 but not on sparc or x86_64. Try to
reproduce the test situation in platform_int.

The platform code in t_integration.sh was not strict enough, it didn't
check for multiple conditions, such as in msg_132_ilp32. That test was
only supposed to run on ILP32 platforms where size_t is unsigned int. It
also ran on sparc, even though size_t is long there.
 1.112 13-Sep-2021  rillig tests/lint: add more tests for direct-abstract-declarator

Lint's grammar in this area differs a lot from the grammar in C99. GCC's
parser has a long comment about special cases in this area. It's tricky
to even parse these type names correctly, let alone assign them the
correct types, that's why it needs more tests before trying to refactor
that code.
 1.111 12-Sep-2021  rillig lint: add more details to error about redeclaration

Message 27 is triggered by several conditions. The one triggered by
register_vget in sbin/fsck_lfs/vnode.c needs more details than the
others.
 1.110 10-Sep-2021  rillig tests/lint: test line number tracking with \v and \f
 1.109 03-Sep-2021  rillig tests/lint: test GCC builtins for overflow in strict bool mode

Seen in inetd.c.
 1.108 31-Aug-2021  rillig tests/lint: add test for prototype conversions in C90

The purpose of warning 259 is to find function calls that differ in the
ABI. The warning's original purpose was not to warn about lossy
conversions, that's just a side effect.

Warning 259 had been implemented before C99 was published, which is more
than 20 years ago. In the meantime, almost all code has migrated to
using function prototypes. With the default lint flags from NetBSD's
<sys.mk>, it would rather make sense to focus on lossy conversions now.

To prepare for potentially upcoming differences in lint's C90 and C99
modes, clone the test now as far as possible. The test for C90 mode is
smaller than for C99 mode, since 'long long' was not available back
then.
 1.107 25-Aug-2021  rillig tests/lint: test conversion from long long to intptr_t on ilp32

Seen in usr.bin/make/var.c:1608.
 1.106 22-Aug-2021  rillig tests/lint: demonstrate wrong constant folding in strict bool mode

Found while investigating wrong constant folding in default mode.
 1.105 19-Aug-2021  rillig tests/lint: test folding of constant expressions

Since November 2001, there is a comment above the function 'fold' that
suggests there are a few bugs concerning overflow detection. Add some
first 'proper regression tests' to prove these bugs.
 1.104 16-Aug-2021  rillig tests/lint: test arithmetic promotions and enums
 1.103 09-Aug-2021  rillig lint: warn about 'char * = strchr(const char *, int)'

Found in findcc.c, there are about 25 other instances of this
incongruency in the whole source tree.

For more examples of functions from the C Standard Library that
implicitly remove the 'const' qualifier from an argument, see the C++
include file 'cstring'.
 1.102 05-Aug-2021  rillig tests/lint: test emitting 128-bit integer types for lint2
 1.101 03-Aug-2021  rillig tests/lint: test GCC extension for casting to union type
 1.100 03-Aug-2021  rillig tests/lint: test casting a struct to another struct
 1.99 01-Aug-2021  rillig tests/lint: test the usual arithmetic conversions in traditional C
 1.98 01-Aug-2021  rillig tests/lint: test the usual arithmetic conversions

The function 'balance' does not mention __uint128_t and nevertheless
works as expected. Need to investigate further.
 1.97 25-Jul-2021  rillig tests/lint: cover every code line in the grammar
 1.96 25-Jul-2021  rillig tests/lint: test declarators with attributes
 1.95 25-Jul-2021  rillig tests/lint: demonstrate missing support for GCC typeof
 1.94 25-Jul-2021  rillig tests/lint: test parse errors in statements

These errors are really unrealistic. Most parse errors that occur in
statements are already handled elsewhere and continue with the next
semicolon.

The tests had to be split into two separate files because lint assumes
that after the 5th parse error, it does not make sense to continue this
translation unit.
 1.93 25-Jul-2021  rillig tests/lint: test parsing of type_name
 1.92 15-Jul-2021  rillig tests/lint: cover more edge cases in the parser
 1.91 15-Jul-2021  rillig tests/lint: test struct declarations
 1.90 15-Jul-2021  rillig tests/lint: test precedence of operators
 1.89 14-Jul-2021  rillig tests/lint: add several tests for edge cases in the grammar
 1.88 13-Jul-2021  rillig tests/lint: test binary integer literals and underscores
 1.87 13-Jul-2021  rillig tests/lint: take archsubdir from usr.bin/xlint/Makefile.inc

This fixes the tests on the various ARM platforms where the platform
name does not correspond to MACHINE_ARCH, such as earmv7hf.
 1.86 11-Jul-2021  rillig lint: support __attribute__((hot))

The corresponding attribute 'cold' was already added in cgram.y 1.84
from 2016-12-29.
 1.85 11-Jul-2021  rillig tests/lint: test dangling else
 1.84 10-Jul-2021  rillig tests/lint: test declarations
 1.83 10-Jul-2021  rillig tests/lint: add more tests for covering the grammar
 1.82 09-Jul-2021  rillig tests/lint: add test for unrealistic edge cases in declarations

The example code for triggering these grammar rules looks completely
contrived. Even if lint had not implemented these cases, hopefully
nobody would have ever noticed.
 1.81 08-Jul-2021  rillig tests/lint: add tests for C90 mode and malformed declarations

In the grammar, 148 lines are still uncovered by the tests. The
untested parts are mostly obscure declarations and a few parse errors.
 1.80 06-Jul-2021  rillig tests/lint: add tests for GCC __attribute__

Before fixing the wrong handling of __attribute__ that is demonstrated
at the end of gcc_attribute.c, ensure that the attribute handling works
in the most basic cases.

Lint currently accepts __attribute__ in more places than it should.
This leads to some ambiguities in the grammar.
 1.79 04-Jul-2021  rillig test/lint: demonstrate wrong warnings for 128-bit shifts
 1.78 04-Jul-2021  rillig lint: remove remaining support for lvalue casts

These had been GCC extensions until GCC 3.4, they were removed in GCC
4.0.
 1.77 04-Jul-2021  rillig tests/lint: re-enable test c99_bool_strict_suppressed

It had been disabled accidentally in the previous commit.
 1.76 04-Jul-2021  rillig lint: remove outdated assertion

Since err.c 1.12 from 2000-07-06, lint allows to suppress individual
error messages. Suppressed error messages do not increment nerr.
Keeping nerr at 0 had triggered the assertion.
 1.75 04-Jul-2021  rillig tests/lint: add test for suppressing errors in strict bool mode
 1.74 03-Jul-2021  rillig tests/lint: fix test for character comparison on macppc

On macppc, char == unsigned char, which generates one more warning than
on platforms where char == signed char.
 1.73 02-Jul-2021  rillig tests/lint: add test for array subscripts in C99 initialization
 1.72 29-Jun-2021  rillig lint: fix wrong warning about out-of-range value '\xff' for char

This only affects platforms where char has the same representation as
unsigned char.
 1.71 29-Jun-2021  rillig tests/lint: add test that only runs where char == unsigned char

There a 4 regular NetBSD builds where lint is activated. All these
builds run on platforms where char == signed char.

The official test runs from https://releng.netbsd.org/test-results.html
mostly have char == signed char as well.

However, lint behaves differently on platforms with char == unsigned
char. On these platforms, a simple "char ch = '\xff'" leads to the
bogus warning that "conversion of 'int' to 'char' is out of range".
 1.70 29-Jun-2021  rillig tests/lint: add 'make accept' to update the expected output
 1.69 29-Jun-2021  rillig tests/lint: add tests for ILP32 platforms

Previously, all tests for lint had to produce the exact same output, no
matter which platform they ran on. This differs from practical needs
since lint is intended to produce different results depending on whether
the platform is ILP32 or LP64.

Examples for these are type conversions and the widths of the integer
types during lexical analysis.
 1.68 27-Jun-2021  rillig lint: require C11 for _Generic

This does not have any effect in practice since the option -g
(originally meant for GCC extensions to the C standards) implicitly
allows all features from C11, since err.c 1.111 from 2021-04-14.

Since the default lint flags for NetBSD builds include the option -g,
this allows all C11 features.

Currently it is not possible to say "allow GNU extensions but not C11".
 1.67 27-Jun-2021  rillig lint: fix option -Ac11, add test for _Generic

Previously, selecting the option -Ac11 allowed features from C11 but at
the same time prohibited 'long long', which was added in C99. This was
caused by the option -s, which is interpreted as "allow features from
C90, but no later".

The test for _Generic, which has been added in C11, demonstrates that
the current implementation is broken. Lint currently thinks that the
return type of a _Generic selection is the type of the expression, but
it really is the type of the selected expression. In the current tests,
this is always 'const char *', but C11 does not require that the types
of a generic selection are compatible.
 1.66 27-Jun-2021  rillig tests/lint: rename expected .ln file to .exp-ln

This way, the hack for suffixes is no longer needed.
 1.65 20-Jun-2021  rillig tests/lint: test syntax error in initialization using designator

This test prepares the upcoming refactoring of the grammar.
 1.64 19-Jun-2021  rillig lint: fix endless loop on unfinished comment at EOF

Found using afl.
 1.63 19-Jun-2021  rillig lint: fix assertion after malformed for loop

Found using afl.
 1.62 19-Jun-2021  rillig lint: fix assertion failure in struct with unnamed member

Found using afl.
 1.61 19-Jun-2021  rillig lint: fix crash in malformed initialization
 1.60 19-Jun-2021  rillig tests/lint: add test cases for lexical analysis
 1.59 25-May-2021  rillig tests/lint: make test d_gcc_extension platform-independent

That test was intended to test the keywords '__extension__' and
'__typeof'. The GCC builtin functions were just a side-effect.

These built-in functions generated error messages on platforms such as
amd64 where sizeof(long double) != sizeof(double), but not on others
such as sparc.

The current infrastructure for the lint tests cannot handle tests with
platform-dependent outcome.
 1.58 16-May-2021  rillig lint: add more specific warning for bit-field of type plain 'int'

Previously, declaring a bit-field of type plain 'int' resulted in this
warning:

warning: nonportable bit-field type 'int' [34]

This warning was too unspecific to be actionable, and until yesterday it
didn't even include the type. In order to allow this warning to be
understood and properly fixed, describe the actual nonportability more
precisely:

warning: bit-field of type plain 'int' has
implementation-defined signedness [344]
 1.57 15-May-2021  rillig lint: warn about unreachable case labels for '&&'

See octeon_gmxreg.h 1.2 from 2020-06-18 for an example, where
RXN_RX_INBND_SPEED was cleaned up without adjusting the corresponding
code in octeon_gmx.c.
 1.56 14-May-2021  rillig tests/lint: test bitwise mismatch in switch statement
 1.55 02-May-2021  rillig branches: 1.55.2;
tests/lint: add test for bit-field types in GCC mode
 1.54 02-May-2021  rillig tests/lint: demonstrate missing support for __packed __aligned
 1.53 30-Apr-2021  rillig tests/lint: add very basic tests for GCC __attribute__
 1.52 22-Apr-2021  rillig tests/lint: add test for typeof after statement

Found by christos@.
 1.51 21-Apr-2021  christos Put things back, emit.ln it was meant to be there.
 1.50 21-Apr-2021  christos remove emit.ln; looks like an accident and breaks the build.
 1.49 21-Apr-2021  rillig tests/lint: fix the hack for emit.ln to also work if MKUPDATE != "no"
 1.48 20-Apr-2021  rillig tests/lint: fix inconsistent operator for emit.ln

The build failed with:

nbmake[8]: "/.../src/share/mk/bsd.files.mk" line 47:
Inconsistent operator for /.../emit.ln
 1.47 20-Apr-2021  rillig tests/lint1: fix build error "must name an existing directory"

The build failed with this error message:

x86_64--netbsd-install: the last argument (/.../emit.ln) must
name an existing directory

The cause for this message was that ${DESTDIR}/.../emit.ln has
${DESTDIR}/.../emit.c as implicit target, which is kind of correct but
unintended in this case. Because of this, the command 'install' was run
like this:

install ${NETBSDSRCDIR}/.../emit.ln ${DESTDIR}/.../emit.c \
${DESTDIR}/.../emit.ln
 1.46 18-Apr-2021  rillig tests/lint: record all files from FILES in distrib/sets/lists/tests/mi
 1.45 18-Apr-2021  rillig tests/lint: add emit.ln to the release files
 1.44 18-Apr-2021  rillig lint: test emitting of symbol information in the .ln files

Even though the new test is quite large, it didn't find any bugs in the
code. The only thing I'm unsure about is why static functions are
exported as well, since they are supposed to be local to the translation
unit.
 1.43 17-Apr-2021  rillig tests/lint: demonstrate assertion failure in initialization
 1.42 14-Apr-2021  rillig lint: add test for newly added message about static array size
 1.41 09-Apr-2021  rillig tests/lint: demonstrate wrong lint warning about complex variables
 1.40 08-Apr-2021  rillig lint: in code from included files, print stack trace

Previously, the standard NetBSD build generated several lint warnings in
lhash.h from OpenSSL, without providing any hint as to which file
actually included that header. In cases like these, lint now interprets
the line number information in the preprocessor output from GCC to
reconstruct the exact include path to the file in question.

The program check-expect.lua had to be rewritten almost completely since
it assumed that all diagnostics would come from the main file. In all
existing tests, this was true, but these tests did not cover all cases
that occurred in practice. Now it records the complete location of the
diagnostic instead of just the line number.
 1.39 05-Apr-2021  rillig lint: warn about for wrong type cast in argument to ctype.h functions

The argument to most of the functions from <ctype.h> "shall either be
representable as an 'unsigned char' or shall equal the value of the
macro EOF".

When confronted with the infamous warning 'array subscript has type
char', there are enough programmers who don't know the background of
that warning and thus fix it in a wrong way. Neither GCC nor Clang
explain its warning to target these programmers.

Both GCC and Clang warn about 'array subscript has type char', but they
ignore the other requirements of the <ctype.h> functions, even though
these are in the C standard library.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94182
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95177
https://stackoverflow.com/a/60696378
 1.38 02-Apr-2021  rillig tests/lint: prevent typo from tree.c 1.264 from happening again
 1.37 28-Mar-2021  rillig lint: remove wrong warning about wrong initializer type

The following code is valid:

int valid = {{{ 3 }}};

C90 3.5.7 and C99 6.7.8 both say that the "initializer for a scalar
shall be a single expression, optionally enclosed in braces". They
don't put any upper bound on the amount of braces, not even in the
"Translation limits" section.
 1.36 23-Mar-2021  rillig tests/lint: test initialization using string literals

The errors in line 74 and 75 of the test are wrong. Everything is fine
there. The bug lies in init_array_using_string, try to see if you can
spot it, neither GCC 9.3.0 nor Clang 8.0.1 could.
 1.35 07-Mar-2021  rillig lint: in strict C mode, warn about initialization with '[a ... b]'

https://gcc.gnu.org/onlinedocs/gcc/Case-Ranges.html
 1.34 28-Feb-2021  rillig lint: fix null pointer dereference on parse error

Fixes PR bin/22119.
 1.33 28-Feb-2021  rillig lint: add test to demonstrate that PR bin/20264 has been fixed
 1.32 21-Feb-2021  rillig lint: add another test for C99 initializers
 1.31 19-Feb-2021  rillig lint: warn about mismatch in getopt handling
 1.30 17-Jan-2021  rillig lint: add more tests for system headers in strict bool mode
 1.29 14-Jan-2021  rillig lint: add tests for newly added messages for strict bool mode
 1.28 10-Jan-2021  rillig lint: add test for triggering assertion failures in lint1
 1.27 10-Jan-2021  rillig lint: add test for treating _Bool as non-scalar type

This strict mode is not yet implemented. The plan is to use it for
usr.bin/make, to get rid of the many possible variants of defining the
Boolean type in make.h. These variants did find some bugs, but not
reliably so. Using static analysis seems more promising for this.

In an early stage of developing this test, lint1 crashed in the enum
definition in line 213, where the node for the '?:' had been NULL. This
can happen in other situations as well, such as with syntax errors, but
these should be rare, as lint is usually only run if the compiler has
accepted the source code. Still, there should not be any assertion
failures while running lint1.
 1.26 10-Jan-2021  rillig lint: demonstrate wrong handling of conversion to _Bool
 1.25 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.24 01-Jan-2021  rillig lint: demonstrate bug in handling of nested C9X struct initializers
 1.23 01-Jan-2021  rillig lint: fix segmentation fault when checking returned enum types (211)
 1.22 31-Dec-2020  rillig lint: check that in "if (cond)", cond is scalar
 1.21 30-Dec-2020  rillig lint: add test for old style function arguments
 1.20 28-Dec-2020  rillig lint1: add forgotten tests
 1.19 28-Dec-2020  rillig lint1: enable test cvt_constant

This test had never been enabled. In t_integration.sh 1.3 from
2014-04-17 it was supposed to be enabled, but due to a line continuation
backslash, the words "test_case check_valid" ended up as the description
of the previous test, cvt_in_ternary.

While here, add the expected test output for d_struct_init_nested to
FILES.
 1.18 28-Dec-2020  rillig lint1: add test for initializing nested structs

Discovered in var.c 1.774 from 2020-12-28.
 1.17 28-Dec-2020  rillig lint: for tests with output, ensure that the output matches
 1.16 28-Dec-2020  rillig lint: sort tests by name
 1.15 06-Mar-2017  christos add builtin_offsetof
 1.14 06-Mar-2017  christos add a test for a typeof cast
 1.13 19-Aug-2016  christos branches: 1.13.2;
Add union cast test
 1.12 18-Aug-2016  christos new test for struct that only has anon members, and that the size of struct
is computer right.
 1.11 14-Oct-2015  christos branches: 1.11.2;
Add an anonymous struct test
 1.10 29-Jul-2015  christos new test
 1.9 28-Jul-2015  christos new c99 init test found by xorg's Iconify.c
 1.8 01-Jul-2015  christos new test.
 1.7 11-May-2015  christos add one more test
 1.6 03-Apr-2015  christos add test for typename as a function param
 1.5 20-Nov-2014  christos test for c99 flexible packed arrays
 1.4 20-Nov-2014  christos Add one more test
 1.3 17-Apr-2014  christos add more tests
 1.2 04-Feb-2014  njoly branches: 1.2.2;
Handle another declaration after statement case for lint in c99 mode.
Add the corresponding testcase.
 1.1 17-Mar-2012  jruoho branches: 1.1.2; 1.1.4;
Deprecate tests/util.
 1.1.4.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.2.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file Makefile was added on branch yamt-pagecache on 2012-04-17 00:09:22 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.11.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.13.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.55.2.1 31-May-2021  cjep sync with head
 1.18 27-Feb-2025  rillig lint: normalize whitespace
 1.17 03-Jan-2025  rillig lint: add detail to message about obsolete identifier list
 1.16 10-Jul-2024  rillig tests/lint: allow empty lines in .exp-ln files

The generated .ln files neither contain spaces nor empty lines. To make
the input more human-readable, allow empty lines in the expected .ln
files.
 1.15 28-Jan-2024  rillig branches: 1.15.2;
tests/lint: sort multiple diagnostics per line chronologically

For now, the chronologic order is not enforced but has to be established
manually, for example by removing all 'expect' comment lines and
regenerating them with 'accept.sh -u'.

While here, clean up a few instances that came up when regenerating the
'expect' comments, such as wrong indentation or needless deviation from
the 'expect+1' form.
 1.14 08-Jul-2023  rillig tests/lint: automate accepting changed test results
 1.13 08-Jul-2023  rillig tests/lint: only overwrite .exp files if the output actually changes
 1.12 28-Jun-2023  rillig tests/lint: do not overwrite expected files that only differ in spaces
 1.11 19-Jun-2022  rillig tests/lint: add quotes around placeholders in a few messages
 1.10 17-Jun-2022  rillig 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'.
 1.9 16-Apr-2022  rillig lint: in C99 mode, allow trailing comma in enum declarations

Adjust the test to be run in C90 mode instead of traditional mode, since
traditional C didn't have enums.
 1.8 26-Aug-2021  rillig tests/lint: add tests for several messages
 1.7 16-Aug-2021  rillig tests/lint: remove unintended debugging output
 1.6 16-Aug-2021  rillig tests/lint: fix check for expected message in msg tests
 1.5 08-Aug-2021  rillig tests/lint: clean up accept.sh, document test for removed assertion
 1.4 05-Aug-2021  rillig tests/lint: test emitting 128-bit integer types for lint2
 1.3 11-Jul-2021  rillig tests/lint: when accepting test results, skip crashes
 1.2 11-Jul-2021  rillig tests/lint: suppress ShellCheck warnings for intentional violations

The undeclared variables are generated by the AWK program.
The variable 'flags' must be split into words at exactly this point.
 1.1 29-Jun-2021  rillig tests/lint: add 'make accept' to update the expected output
 1.15.2.1 02-Aug-2025  perseant Sync with HEAD
 1.11 18-Sep-2025  rillig lint: in C23 mode, do not warn about an empty parameter list
 1.10 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.9 24-Feb-2025  rillig lint: remove no-op variant of the unary '&' operator

Neither K&R 1978 nor any of the C standards mentions that &function or
&array would be a no-op. This no-op behavior produced wrong warnings in
sbin/gpt.
 1.8 30-Nov-2024  rillig tests/lint: add a few more tests to increase code coverage
 1.7 07-May-2024  rillig branches: 1.7.2;
tests/lint: show that in C23 mode, bool is not yet defined

The tests in C11 and C23 mode look the same right now but will change
soon.

The warnings in the C11 test disappeared because after the first error,
warnings about unused variables are suppressed by check_variable_usage,
as they are often wrong.
 1.6 28-Jan-2024  rillig tests/lint: sort multiple diagnostics per line chronologically

For now, the chronologic order is not enforced but has to be established
manually, for example by removing all 'expect' comment lines and
regenerating them with 'accept.sh -u'.

While here, clean up a few instances that came up when regenerating the
'expect' comments, such as wrong indentation or needless deviation from
the 'expect+1' form.
 1.5 03-Aug-2023  rillig lint: make '_Static_assert' only available in C11 or C23 mode
 1.4 28-Jul-2023  rillig tests/lint: test declarations in C11 and C23
 1.3 13-Jul-2023  rillig lint: in C23 mode, recognize the keyword 'thread_local'
 1.2 12-Jul-2023  rillig lint: reject _Noreturn if it occurs in invalid places

C11 introduced _Noreturn as a function-specifier, not as a type
attribute. The latter may occur in more places.
 1.1 12-Jul-2023  rillig tests/lint: add test for _Noreturn from C11
 1.7.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 07-Jul-2023  rillig 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.4 07-Jul-2023  rillig tests/lint: merge duplicate tests for C11 _Atomic
 1.3 21-Jan-2023  rillig lint: add support for C11 '_Atomic' as atomic-type-specifier

Following the C11 grammar, the keyword '_Atomic' needs to be a separate
syntactic category, to avoid further conflicts in the grammar.

The two newly added conflicts in the grammar would come into play when
mixing traditional C with C11, in a type name without an implicit 'int'.
If the type '_Atomic(int)*' were parsed as '_Atomic int(int)*', the
trailing '*' would be a syntax error.
 1.2 21-Jan-2023  rillig lint: add support for the C11 type qualifier '_Atomic'

That keyword can be used as a type specifier as well, support for that
will be added later.
 1.1 21-Jan-2023  rillig tests/lint: test _Atomic, added in C11
 1.19 06-Aug-2023  rillig lint: since C99, a non-void function must return a value
 1.18 09-Jul-2023  rillig lint: clean up wording in diagnostics

Use the term 'parameter' as defined in C99 3.15.
 1.17 07-Jul-2023  rillig 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.16 07-Jul-2023  rillig tests/lint: merge duplicate tests for C11 _Atomic
 1.15 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.14 04-Jan-2023  rillig tests/lint: fix typo in comment
 1.13 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.12 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.11 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.10 01-Aug-2021  rillig tests/lint: fix test c11_generic_expression on ILP32

These platforms don't provide __uint128_t, at least not in lint.

The exact data type does not matter in this test, it just has to be
different from 'int'.
 1.9 01-Aug-2021  rillig tests/lint: document why lint does not check _Generic selections
 1.8 11-Jul-2021  rillig lint: make _Generic a primary-expression

C11 says so, and unless the _Generic expression was wrapped in
parentheses, it was not possible before to use it as a function call
expression.
 1.7 11-Jul-2021  rillig tests/lint: demonstrate that _Generic must be a primary_expression
 1.6 28-Jun-2021  rillig lint: only accept assignment-expression in _Generic

That's what C11 says.
 1.5 27-Jun-2021  rillig lint: fix parsing of _Generic selection expressions

Previously, lint accepted comma-expressions where only
assignment-expressions are allowed.

This change does not make a difference in practice though since lint is
usually only run on source code that properly compiles. Nevertheless,
rather be precise and accurate since the grammar might some day be
reused on less reliable input.
 1.4 27-Jun-2021  rillig lint: fix type comparison in _Generic selection expressions

In the newly added test comma_expression, there were two distinct type
objects for the tspec DOUBLE.
 1.3 27-Jun-2021  rillig lint: fix result type of _Generic expressions
 1.2 27-Jun-2021  rillig tests/lint: add test for _Generic with incompatible return types
 1.1 27-Jun-2021  rillig lint: fix option -Ac11, add test for _Generic

Previously, selecting the option -Ac11 allowed features from C11 but at
the same time prohibited 'long long', which was added in C99. This was
caused by the option -s, which is interpreted as "allow features from
C90, but no later".

The test for _Generic, which has been added in C11, demonstrates that
the current implementation is broken. Lint currently thinks that the
return type of a _Generic selection is the type of the expression, but
it really is the type of the selected expression. In the current tests,
this is always 'const char *', but C11 does not require that the types
of a generic selection are compatible.
 1.10 17-Jun-2022  rillig 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'.
 1.9 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.8 03-Aug-2021  rillig lint: add quotes around placeholder in message 214

function '%s' expects to return value
 1.7 11-Jul-2021  rillig lint: make _Generic a primary-expression

C11 says so, and unless the _Generic expression was wrapped in
parentheses, it was not possible before to use it as a function call
expression.
 1.6 11-Jul-2021  rillig tests/lint: demonstrate that _Generic must be a primary_expression
 1.5 27-Jun-2021  rillig lint: fix parsing of _Generic selection expressions

Previously, lint accepted comma-expressions where only
assignment-expressions are allowed.

This change does not make a difference in practice though since lint is
usually only run on source code that properly compiles. Nevertheless,
rather be precise and accurate since the grammar might some day be
reused on less reliable input.
 1.4 27-Jun-2021  rillig lint: fix type comparison in _Generic selection expressions

In the newly added test comma_expression, there were two distinct type
objects for the tspec DOUBLE.
 1.3 27-Jun-2021  rillig lint: fix result type of _Generic expressions
 1.2 27-Jun-2021  rillig tests/lint: add test for _Generic with incompatible return types
 1.1 27-Jun-2021  rillig lint: fix option -Ac11, add test for _Generic

Previously, selecting the option -Ac11 allowed features from C11 but at
the same time prohibited 'long long', which was added in C99. This was
caused by the option -s, which is interpreted as "allow features from
C90, but no later".

The test for _Generic, which has been added in C11, demonstrates that
the current implementation is broken. Lint currently thinks that the
return type of a _Generic selection is the type of the expression, but
it really is the type of the selected expression. In the current tests,
this is always 'const char *', but C11 does not require that the types
of a generic selection are compatible.
 1.18 18-Sep-2025  rillig lint: in C23 mode, do not warn about an empty parameter list
 1.17 30-Nov-2024  rillig tests/lint: add a few more tests to increase code coverage
 1.16 17-Jun-2024  rillig branches: 1.16.2;
lint: don't warn about unused C23 [[maybe_unused]] parameters
 1.15 17-Jun-2024  rillig lint: accept C23 [[fallthrough]] statements

Needed by bind9/getaddresses.c:137.
 1.14 17-Jun-2024  rillig lint: accept C23 attributes at the beginning of a type declaration

The switch to GCC 12 brings support for C23, and localtime.c uses it to
mark [[maybe_unused]] parameters.

For now, accept C23 attributes independently from the language level. In
the end, the whole tree with the exception of the tools should be
switched to C23 mode instead of the current C99 mode.

For now, don't actually mark the argument as possibly unused, as lint
currently ignores __attribute__((__unused__)) as well.
 1.13 11-May-2024  rillig lint: parse but otherwise ignore C23 attributes

The C23 attributes are only parsed before an expression in an expression
statement, as a proof of concept. Other places will follow later.
 1.12 09-May-2024  rillig lint: in C23 mode, allow storage classes in compound literals
 1.11 09-May-2024  rillig lint: in C23 mode, support the nullptr constant
 1.10 07-May-2024  rillig lint: in C23 mode, support the keywords 'bool', 'false' and 'true'
 1.9 07-May-2024  rillig tests/lint: show that in C23 mode, bool is not yet defined

The tests in C11 and C23 mode look the same right now but will change
soon.

The warnings in the C11 test disappeared because after the first error,
warnings about unused variables are suppressed by check_variable_usage,
as they are often wrong.
 1.8 28-Jan-2024  rillig tests/lint: sort multiple diagnostics per line chronologically

For now, the chronologic order is not enforced but has to be established
manually, for example by removing all 'expect' comment lines and
regenerating them with 'accept.sh -u'.

While here, clean up a few instances that came up when regenerating the
'expect' comments, such as wrong indentation or needless deviation from
the 'expect+1' form.
 1.7 28-Jul-2023  rillig tests/lint: test declarations in C11 and C23
 1.6 25-Jul-2023  rillig lint: allow 'thread_local' to be combined with 'static'
 1.5 15-Jul-2023  rillig lint: allow 'extern' and 'thread_local' to be combined
 1.4 15-Jul-2023  rillig tests/lint: test 'extern thread_local' storage classes

Seen in external/mpl/bind/dist/lib/isc/pthreads/include/isc/thread.h:32.
 1.3 14-Jul-2023  rillig lint: clean up comments, add a test for the '?:' operator
 1.2 13-Jul-2023  rillig lint: in C23 mode, recognize the keyword 'thread_local'
 1.1 02-Jul-2023  rillig tests/lint: add C23 tests
 1.16.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 30-Nov-2024  rillig tests/lint: add a few more tests to increase code coverage
 1.3 26-Aug-2023  rillig branches: 1.3.2;
lint: make diagnostics about ANSI C more international
 1.2 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.1 25-Jul-2021  rillig tests/lint: cover every code line in the grammar
 1.3.2.1 02-Aug-2025  perseant Sync with HEAD
 1.2 17-Jun-2022  rillig 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'.
 1.1 25-Jul-2021  rillig tests/lint: cover every code line in the grammar
 1.4 07-Jul-2023  rillig tests/lint: merge duplicate tests for C11 _Atomic
 1.3 21-Jan-2023  rillig lint: add support for C11 '_Atomic' as atomic-type-specifier

Following the C11 grammar, the keyword '_Atomic' needs to be a separate
syntactic category, to avoid further conflicts in the grammar.

The two newly added conflicts in the grammar would come into play when
mixing traditional C with C11, in a type name without an implicit 'int'.
If the type '_Atomic(int)*' were parsed as '_Atomic int(int)*', the
trailing '*' would be a syntax error.
 1.2 21-Jan-2023  rillig lint: add support for the C11 type qualifier '_Atomic'

That keyword can be used as a type specifier as well, support for that
will be added later.
 1.1 21-Jan-2023  rillig tests/lint: test _Atomic, added in C11
 1.6 07-Jul-2023  rillig 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.5 19-Jun-2022  rillig lint: add quotes around placeholders in 4 messages
 1.4 08-Aug-2021  rillig tests/lint: clean up accept.sh, document test for removed assertion
 1.3 05-Jul-2021  rillig tests/lint: fix check-expect.lua for empty .exp file

An absent .exp file is equivalent to an empty .exp file. In neither of
these cases must the corresponding .c file declare any expected
diagnostics.
 1.2 04-Jul-2021  rillig lint: remove outdated assertion

Since err.c 1.12 from 2000-07-06, lint allows to suppress individual
error messages. Suppressed error messages do not increment nerr.
Keeping nerr at 0 had triggered the assertion.
 1.1 04-Jul-2021  rillig tests/lint: add test for suppressing errors in strict bool mode
 1.2 04-Jul-2021  rillig lint: remove outdated assertion

Since err.c 1.12 from 2000-07-06, lint allows to suppress individual
error messages. Suppressed error messages do not increment nerr.
Keeping nerr at 0 had triggered the assertion.
 1.1 04-Jul-2021  rillig tests/lint: add test for suppressing errors in strict bool mode
 1.4 05-Feb-2023  rillig tests/lint: remove redundant tests

The names of the tests were misleading: 'recursive' should have been
'nested', and the interesting topic in the 'cast' tests was not the cast
but the pointer dereference.
 1.3 02-Jul-2021  rillig tests/lint: encode the array length in the diagnostic
 1.2 02-Jul-2021  rillig lint: fix initialization of array of unknown size

The size of the resulting array was computed wrong.
 1.1 02-Jul-2021  rillig tests/lint: add test for array subscripts in C99 initialization
 1.4 17-Jun-2022  rillig 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'.
 1.3 02-Jul-2021  rillig tests/lint: encode the array length in the diagnostic
 1.2 02-Jul-2021  rillig lint: fix initialization of array of unknown size

The size of the resulting array was computed wrong.
 1.1 02-Jul-2021  rillig tests/lint: add test for array subscripts in C99 initialization
 1.3 05-Feb-2023  rillig tests/lint: remove redundant tests

The names of the tests were misleading: 'recursive' should have been
'nested', and the interesting topic in the 'cast' tests was not the cast
but the pointer dereference.
 1.2 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.1 20-Jun-2021  rillig tests/lint: test syntax error in initialization using designator

This test prepares the upcoming refactoring of the grammar.
 1.3 17-Jun-2022  rillig 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'.
 1.2 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.1 20-Jun-2021  rillig tests/lint: test syntax error in initialization using designator

This test prepares the upcoming refactoring of the grammar.
 1.14 27-Feb-2025  rillig lint: normalize whitespace
 1.13 03-Jan-2025  rillig tests/lint: run lint1 tests in one fell swoop

This generates fewer details in the ATF test reports, as the
platform-specific tests that are skipped are not mentioned individually.
 1.12 28-Jan-2024  rillig branches: 1.12.2;
tests/lint: enforce diagnostics to be listed in chronologic order

While here, fix the tests on uchar platforms.
 1.11 28-Jan-2024  rillig tests/lint: sort diagnostics in ilp32 tests chronologically
 1.10 28-Jan-2024  rillig tests/lint: sort multiple diagnostics per line chronologically

For now, the chronologic order is not enforced but has to be established
manually, for example by removing all 'expect' comment lines and
regenerating them with 'accept.sh -u'.

While here, clean up a few instances that came up when regenerating the
'expect' comments, such as wrong indentation or needless deviation from
the 'expect+1' form.
 1.9 27-Jan-2024  rillig tests/lint: test integer constants in different language levels
 1.8 11-Aug-2023  rillig tests/lint: test parsing of preprocessing directives
 1.7 08-Jul-2023  rillig tests/lint: fix a few ilp32 tests
 1.6 08-Jul-2023  rillig tests/lint: automate accepting changed test results
 1.5 06-Jul-2023  rillig tests/lint: ensure consistent preprocessor filenames in tests

The deviations often happen when copying or renaming tests.
 1.4 01-Jul-2023  rillig lint: clean up typos
 1.3 28-Jun-2023  rillig tests/lint: fix preprocessor line number validation

When running the tests via ATF, the filename was an absolute filename,
while the preprocessing line in the test file uses a relative filename.
These two didn't match.
 1.2 19-Jun-2022  rillig tests/lint: add quotes around placeholders in a few messages
 1.1 17-Jun-2022  rillig tests/lint: move check-expect.lua to tests/lint1

It is only used for testing lint1, not for lint2 or xlint.
 1.12.2.1 02-Aug-2025  perseant Sync with HEAD
 1.12 07-Jul-2023  rillig 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.11 30-Jun-2023  rillig tests/lint: extend tests for sizeof and alignof
 1.10 30-Jun-2023  rillig lint: make alignof(incomplete enum) an error
 1.9 30-Jun-2023  rillig tests/lint: add more tests for sizeof, offsetof, alignof
 1.8 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.7 12-May-2022  rillig lint: merge duplicate grammar rules for __alignof__ expr

This allows expressions like '__alignof__(ptr)->member', just as with
'sizeof'.

The upper rule in the grammar was preferred over the lower rule since it
shifted the T_LPAREN instead of reducing unary_expression. Its
implementation invoked undefined behavior if the expression was NULL
since it didn't assign anything to $$.
 1.6 12-May-2022  rillig tests/lint: add more tests for __alignof__
 1.5 12-May-2022  rillig lint: add support for __alignof__ expr, a GCC extension

Seen in lib/libc/gmon/gmon.c:153.
 1.4 12-May-2022  rillig lint: fix support for __alignof__, add support for __alignof

Broken since lex.c 1.129 from yesterday.
 1.3 12-May-2022  rillig tests/lint: adjust tests to reflect missing support of __alignof__

The change in lex.c 1.129 attempted to add support for __alignof, in
addition to the existing support for __alignof__. It failed by removing
support for __alignof__, while allowing the plain 'alignof' instead.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_alignof.c was added on branch yamt-pagecache on 2012-04-17 00:09:22 +0000
 1.6 17-Jun-2022  rillig 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'.
 1.5 12-May-2022  rillig lint: merge duplicate grammar rules for __alignof__ expr

This allows expressions like '__alignof__(ptr)->member', just as with
'sizeof'.

The upper rule in the grammar was preferred over the lower rule since it
shifted the T_LPAREN instead of reducing unary_expression. Its
implementation invoked undefined behavior if the expression was NULL
since it didn't assign anything to $$.
 1.4 12-May-2022  rillig tests/lint: add more tests for __alignof__
 1.3 12-May-2022  rillig lint: add support for __alignof__ expr, a GCC extension

Seen in lib/libc/gmon/gmon.c:153.
 1.2 12-May-2022  rillig lint: fix support for __alignof__, add support for __alignof

Broken since lex.c 1.129 from yesterday.
 1.1 12-May-2022  rillig tests/lint: adjust tests to reflect missing support of __alignof__

The change in lex.c 1.129 attempted to add support for __alignof, in
addition to the existing support for __alignof__. It failed by removing
support for __alignof__, while allowing the plain 'alignof' instead.
 1.3 09-Jan-2024  rillig lint: allow complex offsetof(type, member-designator)

Both GCC 11 and Clang 8 accept member-designators that are not
identifiers but designator sequences, such as in 'offsetof(struct stat,
st_atim.tv_sec)', so make lint accept them as well.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 06-Mar-2017  christos branches: 1.1.2; 1.1.4;
new test
 1.1.4.2 21-Apr-2017  bouyer Sync with HEAD
 1.1.4.1 06-Mar-2017  bouyer file d_bltinoffsetof.c was added on branch bouyer-socketcan on 2017-04-21 16:54:13 +0000
 1.1.2.2 20-Mar-2017  pgoyette Sync with HEAD
 1.1.2.1 06-Mar-2017  pgoyette file d_bltinoffsetof.c was added on branch pgoyette-localcount on 2017-03-20 06:58:02 +0000
 1.4 10-Jul-2021  rillig lint: remove noclass_declmods from grammar

That rule was hard to understand since it contained clrtyp but not the
corresponding deftyp. It's easier to read when a grammar rule contains
both clrtyp and deftyp in the same line.

C99 does not mention the term 'decl-modifier' anywhere, and in fact the
only thing that this grammar rule allowed was a type-qualifier-list.
The new name better reflect this.

No functional change.
 1.3 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.2 16-Jan-2021  rillig lint: normalize whitespace in tests
 1.1 14-Oct-2015  christos Add an anonymous struct test
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 20-Feb-2021  rillig lint: clean up some of the C99 tests

Several C99 tests do not actually test C99 features but instead GCC
features. All these tests should be double-checked again.

In some other tests, split the initializers into more lines, which makes
it easier to read the debug log corresponding to these tests. This will
be necessary for reworking the initializer code to actually conform to
C99.
 1.3 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 18-Aug-2016  christos branches: 1.1.2;
new test for struct that only has anon members, and that the size of struct
is computer right.
 1.1.2.2 14-Sep-2016  pgoyette Sync with HEAD
 1.1.2.1 18-Aug-2016  pgoyette file d_c99_anon_union.c was added on branch pgoyette-localcount on 2016-09-14 03:04:19 +0000
 1.11 03-Jul-2023  rillig tests/lint: clean up tests for C99 bool
 1.10 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.9 16-Jan-2022  rillig tests/lint: update comment to reality
 1.8 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.7 30-Mar-2021  rillig lint: rewrite handling of initializations, fixing several bugs

The previous implementation had a wrong model of how initialization
happens in C99, its assertions failed in all kind of edge cases and it
was not possible to fix the remaining bugs one at a time without running
into even more obscure assertion failures.

The debug logging was detailed but did not help to clarify the
situation. After about 20 failed attempts at fixing the small details I
decided to start all over and rewrite the initialization code from
scratch. I left the low-level parts of handling designators, the code
that is independent of brace_level and the high-level parts of how the
parser calls into this module. Everything else is completely new.

The concept of a brace level stays since that is how C99 describes
initialization. The previous code could not handle multi-level
designations (see d_init_pop_member.c). There are no more assertion
failures in the initialization code.

Some TODO comments have been left in the tests to keep the line numbers
the same in this commit. These will be cleaned up in a follow-up
commit.

The new implementation does not handle initialization with "missing"
braces. This is an edge case that both GCC and Clang warn about, so it
is not widely used. If necessary, it may be added later.

The new implementation does not use any global variables in the vast
majority of the functions, to make all dependencies and possible
modifications obvious.
 1.6 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.5 10-Jan-2021  rillig lint: explain missing error for _Bool constant expressions
 1.4 10-Jan-2021  rillig lint: fix conversion of non-constant scalar to _Bool
 1.3 10-Jan-2021  rillig lint: fix conversion of constant expressions to _Bool
 1.2 10-Jan-2021  rillig lint: add test for converting non-constant expressions to _Bool
 1.1 10-Jan-2021  rillig lint: demonstrate wrong handling of conversion to _Bool
 1.9 17-Jun-2022  rillig 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'.
 1.8 16-Jan-2022  rillig tests/lint: update comment to reality
 1.7 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.6 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.5 10-Jan-2021  rillig lint: explain missing error for _Bool constant expressions
 1.4 10-Jan-2021  rillig lint: fix conversion of non-constant scalar to _Bool
 1.3 10-Jan-2021  rillig lint: fix conversion of constant expressions to _Bool
 1.2 10-Jan-2021  rillig lint: add test for converting non-constant expressions to _Bool
 1.1 10-Jan-2021  rillig lint: demonstrate wrong handling of conversion to _Bool
 1.56 07-Jul-2025  rillig lint: disable message 207 about 'loop not entered at top'

The purpose of the message is unclear, and it produces several warnings
in legitimate code.
 1.55 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.54 10-Apr-2025  rillig lint: remove now-unnecessary CONSTCOND comments
 1.53 10-Apr-2025  rillig lint: do not warn about constant operand of '!'

Like its related warning about a constant condition, the purpose of this
warning is unclear, and suppressing the warning requires special lint
comments, thus cluttering the code.

The message itself is still kept in err.c to keep the '-X 239' option
valid. These LINTFLAGS will be removed in a follow-up commit.

The lint comments /* CONSTCOND */, as well as its more verbose forms /*
CONSTANTCOND */ and /* CONSTANTCONDITION */ are no longer needed and can
be removed.
 1.52 06-Apr-2025  rillig lint: remove warning about 'constant in conditional context'

In a full NetBSD build, this warning occurs about 2400 times, making it
the top 9 warning overall. There is no evidence though that this
warning detects any real bugs, so the noise it makes is not warranted.

In this first step, the warning is still listed in the lint(7) manual
page, as removing it from there would immediately make all places with
"LINTFLAGS += -X 161" fail. These '-X 161' flags cannot be removed
first because then, the warning would step in and make the build fail.

The next step is to clean up the "-X 161" options from all LINTFLAGS,
and then the final step is to remove the warning from err.c.
 1.51 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.50 12-May-2024  rillig branches: 1.50.2;
lint: in strict bool mode, allow do-while-0

Even though 0 is not a boolean constant, allow this common idiom, to
help in those cases where the C preprocessor used by lint does not mark
tokens as coming from system headers (Clang).
 1.49 12-May-2024  rillig tests/lint: clean up tests for strict bool mode
 1.48 30-Dec-2023  rillig tests/lint: sync comments in test for strict bool mode with reality
 1.47 30-Dec-2023  rillig lint: in strict bool mode, allow 'a & b' in controlling expressions

Previously, the expression 'a & b' was only treated as bool if 'a' had
enum type. This didn't cover cases in which bit masks were implemented
using integer types instead of enum sets.
 1.46 30-Dec-2023  rillig tests/lint: test '&' for non-enum types in strict bool mode
 1.45 10-Dec-2023  rillig lint: clean up comments

No functional change.
 1.44 02-Aug-2023  rillig lint: distinguish between arguments and parameters
 1.43 09-Jul-2023  rillig lint: clean up wording in diagnostics

Use the term 'parameter' as defined in C99 3.15.
 1.42 09-Jul-2023  rillig lint: remove redundant '#' after 'argument' in diagnostics
 1.41 03-Jul-2023  rillig tests/lint: clean up tests for C99 bool
 1.40 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.39 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.38 19-Jun-2022  rillig lint: add quotes around placeholders in 4 messages
 1.37 27-Feb-2022  rillig lint: encode lifetime of allocated memory in the function names

No functional change.
 1.36 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.35 20-Nov-2021  rillig tests/lint: fix negation in explanation for strict bool mode
 1.34 16-Nov-2021  rillig lint: fix check for function calls in strict bool mode

Previously, if a function call occurred in the controlling expression,
its return type could be any scalar, not just bool. This was against
the goal of strict bool mode, which makes bool a separate and
incompabile type to all other types. For example, it would allow
controlling expressions like 'strcmp(a, b)' without the usual '!= 0',
but only if at least one of 'a' and 'b' came from a macro definition
from a system header.

The fix is that the decision of whether the type of the controlling
expression may be scalar is no longer based on the operand types but on
the main operator of the controlling expression.
 1.33 16-Nov-2021  rillig lint: fix wrong error message in strict bool mode

This fix only affects the last token before a macro, as well as the last
token in the expanded macro.
 1.32 16-Nov-2021  rillig tests/lint: explain the missing error message in strict bool mode

There are 2 separate bugs that lead to the missing error message.

The first bug is that when parsing a name, the information about whether
that name comes from a system header is not properly recorded for the
last token before switching from or to a system header.

The second bug is that for determining whether the type of a function
call expression is relaxed, the types of the function call arguments are
taken into account, even though the type only depends on the function
itself. The same idea applies to the operators '<<' and '>>', as their
result type only depends on the left operand, at least since C90.
 1.31 14-Nov-2021  rillig tests/lint: demonstrate missing errors for strict bool mode

Seen in bin/echo/echo.c.
 1.30 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.29 02-Jul-2021  rillig lint: no special check for unary operators in strict bool mode

All interesting constellations regarding unary operators are already
covered by the simple model from ops.def.

No functional change.
 1.28 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.27 23-Mar-2021  rillig tests/lint: fix outdated comments
 1.26 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.25 21-Mar-2021  rillig tests/lint: sync redundant documentation in test for strict bool mode
 1.24 20-Mar-2021  rillig lint: in strict bool mode, check initialization as well

C99 6.7.8p11 says for initialization that "the same type constraints and
conversions as for simple assignments apply", so actually apply them.
(I had just forgotten this "operator" when I first implemented strict
bool mode.)
 1.23 20-Mar-2021  rillig tests/lint: test initialization in strict bool mode

I somehow forgot to list INIT as one of the operators in
is_assignment_bool_or_other.
 1.22 27-Feb-2021  rillig tests/lint: allow 'expect' comments to refer to other lines

This allows /* expect+1: ... */ to refer to the following line, as well
as /* expect-1: ... */ to refer to the previous line. This avoids
horizontal scrolling to see the expectations, it also allows these
expectations comments to be more verbose, mentioning the whole
diagnostic in many cases.

The 'expect' comments don't need to be at the end of a line anymore
since that was rather surprising. The one 'expect' comment that had not
been at the end of the line was in d_c99_bool_strict.c and was not
intended to be ignored.
 1.21 20-Feb-2021  rillig lint: do not warn about 'do { ... } while (false)' in strict bool mode
 1.20 20-Feb-2021  rillig lint: add test for 'do { ... } while (false)' in strict bool mode

Right now, this variant of the popular macro pattern is flagged as
needing a /*CONSTCOND*/ annotation. As with 'do { ... } while (0)',
there is nothing wrong with this pattern, therefore there should be no
warning.
 1.19 20-Feb-2021  rillig lint: enable heuristics in test for strict bool mode

This is a preparation for allowing 'do { ... } while (false)', in
addition to the commonly used 'do { ... } while (0)', without declaring
the controlling expression /*CONSTCOND*/.
 1.18 20-Feb-2021  rillig lint: add test for using a bool as array index in strict bool mode
 1.17 17-Jan-2021  rillig lint: add more tests for system headers in strict bool mode
 1.16 17-Jan-2021  rillig lint: add test for macro from system header in strict bool mode

Seen in usr.bin/make/meta.c:1670: FD_ZERO(&readfds). These macros
cannot be fixed since system headers must not include <stdbool.h>.
Therefore INT constants should be accepted as controlling expressions as
well.
 1.15 17-Jan-2021  rillig lint: in strict bool mode, don't treat bool as arithmetic type
 1.14 17-Jan-2021  rillig lint: explain failing test case in strict bool mode
 1.13 17-Jan-2021  rillig lint: demonstrate wrong error message in strict bool mode
 1.12 16-Jan-2021  rillig lint: add missing warning for bool() == int
 1.11 16-Jan-2021  rillig lint: remove redundant calls to before_conversion
 1.10 16-Jan-2021  rillig lint: add test for missing check in strict bool mode
 1.9 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.8 16-Jan-2021  rillig lint: prepare to make strict bool mode even stricter

Currently, strict bool mode still allows integer constant expressions to
be converted implicitly to bool. This is something that other languages
such as Go, Java, C#, Pascal don't allow.

By providing a custom implementation of <stdbool.h> that defines false
and true to custom bool constant identifiers, lint will cover these
cases as well.

To prepare for this, reword the rules and restructure the tests in
d_c99_bool_strict.c.
 1.7 15-Jan-2021  rillig lint: add test for bool bit fields as operands of '|'
 1.6 15-Jan-2021  rillig lint: in strict bool mode, allow bool as operands of the comma operator
 1.5 15-Jan-2021  rillig lint: demonstrate wrong message for comma operator
 1.4 12-Jan-2021  rillig lint: add new check for strict bool mode

In strict bool mode, bool is considered incompatible with all other
scalar types, just as in Java, C#, Pascal.

The controlling expressions in if statements, while loops, for loops and
the '?:' operator must be of type bool. The logical operators work on
bool instead of int, the bitwise operators accept both integer and bool.
The arithmetic operators don't accept bool.

Since <stdbool.h> implements bool using C preprocessor macros instead of
predefining the identifiers "true" and "false", the integer constants 0
and 1 may be used in all contexts that require a bool expression.
Except from these, no implicit conversion between bool and scalar types
is allowed.

See usr.bin/tests/xlint/lint1/d_c99_bool_strict.c for more details.

The command line option -T has been chosen because all obvious choices
(-b or -B for bool, -s or -S for strict) are already in use. The -T may
stand for "types are checked strictly".

The default behavior of lint doesn't change. The strict bool check is
purely optional.

An example program for strict bool mode is usr.bin/make, which has been
using explicit comparisons such as p != NULL, ch != '\0' or n > 0 in
most places for a long time now, even before the refactoring in 2020.
 1.3 11-Jan-2021  rillig lint: extend test for strict _Bool handling

There is no danger in allowing (flags & FLAG) as a controlling
expression, provided that it is immediately compared to zero, such as in
an if statement or as the operand of a logical operator.
 1.2 10-Jan-2021  rillig lint: add enum flags to the test about strict boolean mode
 1.1 10-Jan-2021  rillig lint: add test for treating _Bool as non-scalar type

This strict mode is not yet implemented. The plan is to use it for
usr.bin/make, to get rid of the many possible variants of defining the
Boolean type in make.h. These variants did find some bugs, but not
reliably so. Using static analysis seems more promising for this.

In an early stage of developing this test, lint1 crashed in the enum
definition in line 213, where the node for the '?:' had been NULL. This
can happen in other situations as well, such as with syntax errors, but
these should be rare, as lint is usually only run if the compiler has
accepted the source code. Still, there should not be any assertion
failures while running lint1.
 1.50.2.1 02-Aug-2025  perseant Sync with HEAD
 1.34 17-Jun-2022  rillig 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'.
 1.33 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.32 16-Nov-2021  rillig lint: fix check for function calls in strict bool mode

Previously, if a function call occurred in the controlling expression,
its return type could be any scalar, not just bool. This was against
the goal of strict bool mode, which makes bool a separate and
incompabile type to all other types. For example, it would allow
controlling expressions like 'strcmp(a, b)' without the usual '!= 0',
but only if at least one of 'a' and 'b' came from a macro definition
from a system header.

The fix is that the decision of whether the type of the controlling
expression may be scalar is no longer based on the operand types but on
the main operator of the controlling expression.
 1.31 16-Nov-2021  rillig lint: fix wrong error message in strict bool mode

This fix only affects the last token before a macro, as well as the last
token in the expanded macro.
 1.30 16-Nov-2021  rillig tests/lint: explain the missing error message in strict bool mode

There are 2 separate bugs that lead to the missing error message.

The first bug is that when parsing a name, the information about whether
that name comes from a system header is not properly recorded for the
last token before switching from or to a system header.

The second bug is that for determining whether the type of a function
call expression is relaxed, the types of the function call arguments are
taken into account, even though the type only depends on the function
itself. The same idea applies to the operators '<<' and '>>', as their
result type only depends on the left operand, at least since C90.
 1.29 14-Nov-2021  rillig tests/lint: demonstrate missing errors for strict bool mode

Seen in bin/echo/echo.c.
 1.28 14-Aug-2021  rillig lint: allow initialization of struct with constant member

The operator INIT, just like RETURN and FARG, initializes an object with
an expression. The target object of such an initialization may be a
struct with constant members.

The operator ASSIGN, on the other hand, is entirely different. It
overwrites the existing value of the object, and this is not allowed for
structs that have a constant member. Therefore it was wrong to use the
operator ASSIGN for initialization.
 1.27 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.26 02-Jul-2021  rillig lint: no special check for unary operators in strict bool mode

All interesting constellations regarding unary operators are already
covered by the simple model from ops.def.

No functional change.
 1.25 09-Apr-2021  rillig lint: quote placeholders in messages for unused variables
 1.24 02-Apr-2021  rillig lint: reword message about constant argument to '!'

In the other messages, operators are typically written in their literal
form as well. Using single quotes disambiguates them from normal
punctuation.
 1.23 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.22 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.21 21-Mar-2021  rillig tests/lint: sync redundant documentation in test for strict bool mode
 1.20 20-Mar-2021  rillig lint: in strict bool mode, check initialization as well

C99 6.7.8p11 says for initialization that "the same type constraints and
conversions as for simple assignments apply", so actually apply them.
(I had just forgotten this "operator" when I first implemented strict
bool mode.)
 1.19 20-Feb-2021  rillig lint: do not warn about 'do { ... } while (false)' in strict bool mode
 1.18 20-Feb-2021  rillig lint: add test for 'do { ... } while (false)' in strict bool mode

Right now, this variant of the popular macro pattern is flagged as
needing a /*CONSTCOND*/ annotation. As with 'do { ... } while (0)',
there is nothing wrong with this pattern, therefore there should be no
warning.
 1.17 20-Feb-2021  rillig lint: enable heuristics in test for strict bool mode

This is a preparation for allowing 'do { ... } while (false)', in
addition to the commonly used 'do { ... } while (0)', without declaring
the controlling expression /*CONSTCOND*/.
 1.16 20-Feb-2021  rillig lint: add test for using a bool as array index in strict bool mode
 1.15 17-Jan-2021  rillig lint: add more tests for system headers in strict bool mode
 1.14 17-Jan-2021  rillig lint: add test for macro from system header in strict bool mode

Seen in usr.bin/make/meta.c:1670: FD_ZERO(&readfds). These macros
cannot be fixed since system headers must not include <stdbool.h>.
Therefore INT constants should be accepted as controlling expressions as
well.
 1.13 17-Jan-2021  rillig lint: in strict bool mode, don't treat bool as arithmetic type
 1.12 17-Jan-2021  rillig lint: explain failing test case in strict bool mode
 1.11 17-Jan-2021  rillig lint: demonstrate wrong error message in strict bool mode
 1.10 16-Jan-2021  rillig lint: simplify typeok_strict_bool_compatible
 1.9 16-Jan-2021  rillig lint: add missing warning for bool() == int
 1.8 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.7 16-Jan-2021  rillig lint: prepare to make strict bool mode even stricter

Currently, strict bool mode still allows integer constant expressions to
be converted implicitly to bool. This is something that other languages
such as Go, Java, C#, Pascal don't allow.

By providing a custom implementation of <stdbool.h> that defines false
and true to custom bool constant identifiers, lint will cover these
cases as well.

To prepare for this, reword the rules and restructure the tests in
d_c99_bool_strict.c.
 1.6 15-Jan-2021  rillig lint: add test for bool bit fields as operands of '|'
 1.5 15-Jan-2021  rillig lint: in strict bool mode, allow bool as operands of the comma operator
 1.4 15-Jan-2021  rillig lint: demonstrate wrong message for comma operator
 1.3 12-Jan-2021  rillig lint: add new check for strict bool mode

In strict bool mode, bool is considered incompatible with all other
scalar types, just as in Java, C#, Pascal.

The controlling expressions in if statements, while loops, for loops and
the '?:' operator must be of type bool. The logical operators work on
bool instead of int, the bitwise operators accept both integer and bool.
The arithmetic operators don't accept bool.

Since <stdbool.h> implements bool using C preprocessor macros instead of
predefining the identifiers "true" and "false", the integer constants 0
and 1 may be used in all contexts that require a bool expression.
Except from these, no implicit conversion between bool and scalar types
is allowed.

See usr.bin/tests/xlint/lint1/d_c99_bool_strict.c for more details.

The command line option -T has been chosen because all obvious choices
(-b or -B for bool, -s or -S for strict) are already in use. The -T may
stand for "types are checked strictly".

The default behavior of lint doesn't change. The strict bool check is
purely optional.

An example program for strict bool mode is usr.bin/make, which has been
using explicit comparisons such as p != NULL, ch != '\0' or n > 0 in
most places for a long time now, even before the refactoring in 2020.
 1.2 11-Jan-2021  rillig lint: extend test for strict _Bool handling

There is no danger in allowing (flags & FLAG) as a controlling
expression, provided that it is immediately compared to zero, such as in
an if statement or as the operand of a logical operator.
 1.1 10-Jan-2021  rillig lint: add test for treating _Bool as non-scalar type

This strict mode is not yet implemented. The plan is to use it for
usr.bin/make, to get rid of the many possible variants of defining the
Boolean type in make.h. These variants did find some bugs, but not
reliably so. Using static analysis seems more promising for this.

In an early stage of developing this test, lint1 crashed in the enum
definition in line 213, where the node for the '?:' had been NULL. This
can happen in other situations as well, such as with syntax errors, but
these should be rare, as lint is usually only run if the compiler has
accepted the source code. Still, there should not be any assertion
failures while running lint1.
 1.27 10-Apr-2025  rillig lint: remove now-unnecessary CONSTCOND comments
 1.26 20-Nov-2024  rillig tests/lint: clean up
 1.25 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.24 12-May-2024  rillig branches: 1.24.2;
lint: in strict bool mode, allow do-while-0

Even though 0 is not a boolean constant, allow this common idiom, to
help in those cases where the C preprocessor used by lint does not mark
tokens as coming from system headers (Clang).
 1.23 12-May-2024  rillig tests/lint: clean up tests for strict bool mode
 1.22 06-Aug-2023  rillig lint: since C99, a non-void function must return a value
 1.21 02-Aug-2023  rillig lint: distinguish between arguments and parameters
 1.20 09-Jul-2023  rillig lint: remove redundant '#' after 'argument' in diagnostics
 1.19 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.18 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.17 19-Jun-2022  rillig lint: add quotes around placeholders in 4 messages
 1.16 11-Jun-2022  rillig tests/lint: demonstrate wrong syshdr check in strict bool mode
 1.15 20-May-2022  rillig tests/lint: sync comment with reality
 1.14 19-May-2022  rillig lint: in strict bool mode, check function arguments more strictly

When a system header defined the constant FALSE = 0, that constant could
be passed as a bool argument. On the other hand, the constant TRUE = 1
could not be passed in the same way. Remove this inconsistency.
 1.13 19-May-2022  rillig tests/lint: extend tests for type mismatch in strict bool mode

Seen in games/gomoku when calling curses functions.
 1.12 22-Dec-2021  rillig lint: fix wrong error in strict bool mode in condition with comma

For the result of the comma operator, it doesn't matter whether the
comma itself comes from a system header or not. Instead, it's the main
operator of the right operand.

Since 2021-11-16.
 1.11 22-Dec-2021  rillig lint: clean up lex.c

Rename 'struct kwtab' to 'struct keyword' since a single keyword is not
a whole keyword table.

Sync comment for lex_name with reality: sbuf_t no longer contains the
hash value.

Remove redundant tests for EOF, as EOF is neither a space nor a digit
nor an xdigit.

No functional change.
 1.10 21-Dec-2021  rillig tests/lint: remove false assumptions from comments

https://stackoverflow.com/q/65868752
 1.9 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.8 24-Jan-2021  rillig lint: improve introduction of test d_c99_bool_strict_syshdr
 1.7 24-Jan-2021  rillig lint: explain why !finite(x) is not allowed in strict bool mode
 1.6 23-Jan-2021  rillig lint: apply strict bool mode to lex.c

There are 2 remaining expressions:

In line 244, !(kw->kw_deco & deco) is a bitwise and. This is already
allowed for enums, it needs to be allowed for arbitrary integer
expressions as well. This covers the many places where plain integers
are used for bit fields, together with #define. This pattern is not as
typesafe as using enums, still it is common practice.

In line 769, the expression !finite(f) is a legitimate use of a function
that has return type int for traditional reasons. It's the same as for
ferror.

There are several other functions like unlink, open or strcmp that have
return type int as well, but with a different meaning. It is not yet
clear what the best way is to handle these different meanings. Having
to write finite(f) == 0 in strict bool mode doesn't look idiomatic, on
the other hand, !strcmp(s1, s2) is exactly the pattern that strict bool
mode wants to avoid.
 1.5 23-Jan-2021  rillig lint: fix error message for relaxed bool operations in system headers

In strict mode, allowing 1 as bool constant expression is probably not
needed in practice since most comparisons are != 0 instead of == 0.

Furthermore, in the expression (flags & 0x0002) == true, comparing with
true is misleading since the '==' operator can never evaluate to true in
this case.
 1.4 23-Jan-2021  rillig lint: fix two wrong error messages in strict bool mode

The strict bool mode gets complicated because for system headers the
rules need to be relaxed since they cannot be changed easily, often not at all.

Still, if lint validates a program in strict bool mode, that program
must run with equal behavior regarding boolean expressions even on a
pre-C99 platform.
 1.3 23-Jan-2021  rillig lint: extend test for strict bool mode and system headers
 1.2 17-Jan-2021  rillig lint: allow system headers to use int as bool, even in strict bool mode
 1.1 17-Jan-2021  rillig lint: add more tests for system headers in strict bool mode
 1.24.2.1 02-Aug-2025  perseant Sync with HEAD
 1.18 17-Jun-2022  rillig 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'.
 1.17 11-Jun-2022  rillig tests/lint: demonstrate wrong syshdr check in strict bool mode
 1.16 19-May-2022  rillig lint: in strict bool mode, check function arguments more strictly

When a system header defined the constant FALSE = 0, that constant could
be passed as a bool argument. On the other hand, the constant TRUE = 1
could not be passed in the same way. Remove this inconsistency.
 1.15 19-May-2022  rillig tests/lint: extend tests for type mismatch in strict bool mode

Seen in games/gomoku when calling curses functions.
 1.14 22-Dec-2021  rillig lint: fix wrong error in strict bool mode in condition with comma

For the result of the comma operator, it doesn't matter whether the
comma itself comes from a system header or not. Instead, it's the main
operator of the right operand.

Since 2021-11-16.
 1.13 22-Dec-2021  rillig lint: clean up lex.c

Rename 'struct kwtab' to 'struct keyword' since a single keyword is not
a whole keyword table.

Sync comment for lex_name with reality: sbuf_t no longer contains the
hash value.

Remove redundant tests for EOF, as EOF is neither a space nor a digit
nor an xdigit.

No functional change.
 1.12 21-Dec-2021  rillig tests/lint: remove false assumptions from comments

https://stackoverflow.com/q/65868752
 1.11 14-Aug-2021  rillig lint: allow initialization of struct with constant member

The operator INIT, just like RETURN and FARG, initializes an object with
an expression. The target object of such an initialization may be a
struct with constant members.

The operator ASSIGN, on the other hand, is entirely different. It
overwrites the existing value of the object, and this is not allowed for
structs that have a constant member. Therefore it was wrong to use the
operator ASSIGN for initialization.
 1.10 03-Aug-2021  rillig lint: add quotes around placeholder in message 214

function '%s' expects to return value
 1.9 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.8 24-Jan-2021  rillig lint: improve introduction of test d_c99_bool_strict_syshdr
 1.7 24-Jan-2021  rillig lint: explain why !finite(x) is not allowed in strict bool mode
 1.6 23-Jan-2021  rillig lint: apply strict bool mode to lex.c

There are 2 remaining expressions:

In line 244, !(kw->kw_deco & deco) is a bitwise and. This is already
allowed for enums, it needs to be allowed for arbitrary integer
expressions as well. This covers the many places where plain integers
are used for bit fields, together with #define. This pattern is not as
typesafe as using enums, still it is common practice.

In line 769, the expression !finite(f) is a legitimate use of a function
that has return type int for traditional reasons. It's the same as for
ferror.

There are several other functions like unlink, open or strcmp that have
return type int as well, but with a different meaning. It is not yet
clear what the best way is to handle these different meanings. Having
to write finite(f) == 0 in strict bool mode doesn't look idiomatic, on
the other hand, !strcmp(s1, s2) is exactly the pattern that strict bool
mode wants to avoid.
 1.5 23-Jan-2021  rillig lint: fix error message for relaxed bool operations in system headers

In strict mode, allowing 1 as bool constant expression is probably not
needed in practice since most comparisons are != 0 instead of == 0.

Furthermore, in the expression (flags & 0x0002) == true, comparing with
true is misleading since the '==' operator can never evaluate to true in
this case.
 1.4 23-Jan-2021  rillig lint: fix two wrong error messages in strict bool mode

The strict bool mode gets complicated because for system headers the
rules need to be relaxed since they cannot be changed easily, often not at all.

Still, if lint validates a program in strict bool mode, that program
must run with equal behavior regarding boolean expressions even on a
pre-C99 platform.
 1.3 23-Jan-2021  rillig lint: extend test for strict bool mode and system headers
 1.2 17-Jan-2021  rillig lint: allow system headers to use int as bool, even in strict bool mode
 1.1 17-Jan-2021  rillig lint: add more tests for system headers in strict bool mode
 1.3 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_c99_complex_num.c was added on branch yamt-pagecache on 2012-04-17 00:09:22 +0000
 1.13 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.12 05-Feb-2023  rillig tests/lint: clean up

The .exp files are no longer kept under version control, so there's no
reason anymore to forcefully trigger a warning or an error.
 1.11 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.10 19-Jun-2022  rillig lint: add quotes around placeholders in 4 messages
 1.9 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.8 11-Jul-2021  rillig tests/lint: test precedence of __real__ and cast_expression
 1.7 09-Apr-2021  rillig lint: fix wrong warning about uninitialized _Complex variable

Seen in divxc3.c.
 1.6 09-Apr-2021  rillig tests/lint: demonstrate wrong lint warning about complex variables
 1.5 27-Mar-2021  rillig tests/lint: move description of tests into the tests themselves

In most cases the descriptions didn't add much to the test name anyway.
 1.4 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.3 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.2 21-Apr-2014  christos branches: 1.2.2; 1.2.4; 1.2.8;
use a different function instead of __builtin_isnan, because it is polymorphic
and we don't handle this yet.
 1.1 17-Apr-2014  christos add more tests
 1.2.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.8.1 21-Apr-2014  tls file d_c99_complex_split.c was added on branch tls-maxphys on 2014-08-20 00:04:53 +0000
 1.2.4.2 10-Aug-2014  tls Rebase.
 1.2.4.1 21-Apr-2014  tls file d_c99_complex_split.c was added on branch tls-earlyentropy on 2014-08-10 06:57:37 +0000
 1.2.2.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.2.1 21-Apr-2014  yamt file d_c99_complex_split.c was added on branch yamt-pagecache on 2014-05-22 11:42:24 +0000
 1.4 17-Jun-2022  rillig 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'.
 1.3 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.2 09-Apr-2021  rillig lint: fix wrong warning about uninitialized _Complex variable

Seen in divxc3.c.
 1.1 09-Apr-2021  rillig tests/lint: demonstrate wrong lint warning about complex variables
 1.4 07-Jul-2023  rillig 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.3 20-Mar-2021  rillig lint: join grammar rules for initialization

The '%prec T_COMMA' is necessary to avoid lots of parse errors in the
lint1 unit tests. Curiously, further down in the grammar, for compound
literals, the '%prec T_COMMA' is not necessary, even though the context
looks very similar.

No functional change.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 11-May-2015  christos one t in literal.
 1.2 11-May-2015  christos one t in literal.
 1.1 11-May-2015  christos add one more test
 1.7 02-Aug-2023  rillig lint: distinguish between arguments and parameters
 1.6 07-Jul-2023  rillig 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.5 22-Jan-2023  rillig tests/lint: merge tests for declaration after statement
 1.4 12-Feb-2022  rillig tests/lint: document where some C99 tests come from

These tests were added due to PR#45417.
 1.3 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_c99_decls_after_stmt.c was added on branch yamt-pagecache on 2012-04-17 00:09:22 +0000
 1.5 22-Jan-2023  rillig tests/lint: merge tests for declaration after statement
 1.4 12-Feb-2022  rillig tests/lint: document where some C99 tests come from

These tests were added due to PR#45417.
 1.3 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_c99_decls_after_stmt2.c was added on branch yamt-pagecache on 2012-04-17 00:09:22 +0000
 1.5 22-Jan-2023  rillig tests/lint: merge tests for declaration after statement
 1.4 12-Feb-2022  rillig tests/lint: document where some C99 tests come from

These tests were added due to PR#45417.
 1.3 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 04-Feb-2014  njoly branches: 1.1.4; 1.1.8;
Handle another declaration after statement case for lint in c99 mode.
Add the corresponding testcase.
 1.1.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.8.1 04-Feb-2014  tls file d_c99_decls_after_stmt3.c was added on branch tls-maxphys on 2014-08-20 00:04:53 +0000
 1.1.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.4.1 04-Feb-2014  yamt file d_c99_decls_after_stmt3.c was added on branch yamt-pagecache on 2014-05-22 11:42:24 +0000
 1.3 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 20-Nov-2014  christos test for c99 flexible packed arrays
 1.5 08-Jun-2024  rillig tests/lint: reorganize tests

Tests for a single working language construct don't usually need a
separate file, they can be grouped together, like in expr.c or gcc.c.
 1.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.2 26-Sep-2014  christos add a test for the bug I fixed yesterday, and explain the tests.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_c99_for_loops.c was added on branch yamt-pagecache on 2012-04-17 00:09:22 +0000
 1.8 08-Jun-2024  rillig tests/lint: group tests by topic
 1.7 07-Jan-2024  rillig lint: fix crash for invalid __func__ (since 2023-01-29)
 1.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 29-Jan-2023  rillig lint: fix definition of __func__
 1.4 29-Jan-2023  rillig lint: demonstrate wrong declaration of __func__
 1.3 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_c99_func.c was added on branch yamt-pagecache on 2012-04-17 00:09:22 +0000
 1.50 08-Jun-2024  rillig tests/lint: group tests by topic
 1.49 09-May-2024  rillig lint: add details to message about too many initializers
 1.48 30-Mar-2024  rillig lint: reword messages about array subscripts to sound more natural
 1.47 28-Jan-2024  rillig tests/lint: sort multiple diagnostics per line chronologically

For now, the chronologic order is not enforced but has to be established
manually, for example by removing all 'expect' comment lines and
regenerating them with 'accept.sh -u'.

While here, clean up a few instances that came up when regenerating the
'expect' comments, such as wrong indentation or needless deviation from
the 'expect+1' form.
 1.46 09-Jul-2023  rillig lint: clean up the wording of a few diagnostics
 1.45 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.44 05-Feb-2023  rillig tests/lint: merge tests for initialization
 1.43 05-Feb-2023  rillig tests/lint: remove redundant tests

The names of the tests were misleading: 'recursive' should have been
'nested', and the interesting topic in the 'cast' tests was not the cast
but the pointer dereference.
 1.42 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.41 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.40 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.39 28-Dec-2021  rillig tests/lint: extend documentation for omitted braces in initializer
 1.38 22-Dec-2021  rillig lint: remove spaces around bit-field colon

As seen in /usr/share/misc/style.

No binary change.
 1.37 22-Dec-2021  rillig tests/lint: improve test for initialization of array of unknown size

Previously, the test didn't show that the size of the resulting object
was updated too early.
 1.36 22-Dec-2021  rillig lint: fix handling of initializations

The implementation from March 2021 added proper support for designators
but didn't model the brace levels correctly. In particular, it could
not handle additional braces or omitted braces. In such a case, lint
skipped the remaining initializers from the initialization. Due to
this, type errors in the remaining initializers went unnoticed. Another
effect was that arrays of unknown size were wrongly reported as having
size 0.

Both GCC and Clang recommend placing braces around each sub-type that is
initialized, such as a struct, union or array. Postfix does not follow
these recommendations, therefore lint had to be disabled in
external/ibm-public/postfix/Makefile.inc. This commit fixes the bugs
mentioned there.
 1.35 21-Dec-2021  rillig lint: make function names a bit more concise

No binary change.
 1.34 17-Dec-2021  rillig tests/lint: add more examples for initialization, from C99
 1.33 09-Apr-2021  rillig lint: fix initialization with brace-enclosed string literal

C99 allows this form in 6.7.8p14 and p15.

The previous lint tests did not cover the case of an array at the top
level of the object to be initialized, they only covered the error cases
(d_c99_init.c, variables 'prefixed_message' and 'message_with_suffix').

Lint is now more generous than strictly required by C99, but since GCC
and Clang already cover the case of 'message_with_suffix', this is ok.

The test d_init_array_using_string.c was wrong before in rejecting the
initializer for 'extra_braces'. I had tested that Clang generated a
warning for this, but I had not inspected its warning carefully enough.
Clang had not warned about the extra braces but only about a type
mismatch since I tested on a platform where wchar_t was 16 bit.
 1.32 09-Apr-2021  rillig tests/lint: demonstrate wrong warning when initializing a string
 1.31 02-Apr-2021  rillig lint: add parentheses after sizeof, as required by share/misc/style

No functional change.
 1.30 01-Apr-2021  rillig lint: do not error out of a struct is initialized without braces

This allows to process lib/libc/gen/sysctl.c 1.38 from 2021-03-30, as
well as its precedessor 1.37, which had a workaround just for lint.

While unusual, C99 allows these.
 1.29 30-Mar-2021  rillig tests/lint: test 'scalar type cannot use designator'
 1.28 30-Mar-2021  rillig tests/lint: remove unnecessary empty lines from test

In a separate commit to not cause an unnecessarily large diff in the
previous commit.
 1.27 30-Mar-2021  rillig lint: add error about out-of-bounds array subscripts

This check is not strictly necessary since any C99 compiler must
diagnose them as well, it is rather meant for demonstrating how to do
the check in lint, and for symmetry with the 'unknown member' error
message. These provide insight into how the data structures in init.c
are meant to be accessed.
 1.26 30-Mar-2021  rillig lint: add type information for message about unknown member name
 1.25 30-Mar-2021  rillig tests/lint: remove outdated comments
 1.24 30-Mar-2021  rillig lint: rewrite handling of initializations, fixing several bugs

The previous implementation had a wrong model of how initialization
happens in C99, its assertions failed in all kind of edge cases and it
was not possible to fix the remaining bugs one at a time without running
into even more obscure assertion failures.

The debug logging was detailed but did not help to clarify the
situation. After about 20 failed attempts at fixing the small details I
decided to start all over and rewrite the initialization code from
scratch. I left the low-level parts of handling designators, the code
that is independent of brace_level and the high-level parts of how the
parser calls into this module. Everything else is completely new.

The concept of a brace level stays since that is how C99 describes
initialization. The previous code could not handle multi-level
designations (see d_init_pop_member.c). There are no more assertion
failures in the initialization code.

Some TODO comments have been left in the tests to keep the line numbers
the same in this commit. These will be cleaned up in a follow-up
commit.

The new implementation does not handle initialization with "missing"
braces. This is an edge case that both GCC and Clang warn about, so it
is not widely used. If necessary, it may be added later.

The new implementation does not use any global variables in the vast
majority of the functions, to make all dependencies and possible
modifications obvious.
 1.23 29-Mar-2021  rillig tests/lint: demonstrate assertion failures for union initialization
 1.22 29-Mar-2021  rillig tests/lint: test unknown member name in struct

I had not expected to trigger another assertion, I just wanted to make
sure my latest ongoing refactoring will not break this case. Apparently
there is no need to worry about that.
 1.21 29-Mar-2021  rillig tests/lint: ensure initialization does not modify shared type

In my not yet published rewrite of lint's init.c, I forgot to copy the
array type. Guard against this bug, which would have been hard to find.

Given that in C, the declaration 'int a[], b[]' creates two different
type objects anyway, it's not easy to come up with a test case that
actually triggers this possible bug. I'm not sure whether this test
indeed catches this bug. If not, I'll add another test.
 1.20 29-Mar-2021  rillig tests/lint: add examples for initialization from C99

These all pass lint without any warnings. Both Clang and GCC warn about
these in -Wall mode, so they are unlikely to be seen in practice.
 1.19 28-Mar-2021  rillig lint: add test for assertion failure in initialization

The 'cnt = level->bl_type->t_tspec == STRUCT ? 2 : 1;' in
initialization_push_struct_or_union is obviously wrong since not every
struct has exactly 1 remaining member after the first member that has an
initializer with designation.

This bug started its life in init.c 1.12 from 2002-10-21, a little over
18 years ago.
 1.18 28-Mar-2021  rillig tests/lint: add tests for initialization
 1.17 28-Mar-2021  rillig lint: remove wrong warning about wrong initializer type

The following code is valid:

int valid = {{{ 3 }}};

C90 3.5.7 and C99 6.7.8 both say that the "initializer for a scalar
shall be a single expression, optionally enclosed in braces". They
don't put any upper bound on the amount of braces, not even in the
"Translation limits" section.
 1.16 27-Mar-2021  rillig tests/lint: test initializing a struct ending with unnamed bit-field
 1.15 27-Mar-2021  rillig tests/lint: document expectations in test about array initialization
 1.14 27-Mar-2021  rillig tests/lint: trigger assertion failure in array initialization
 1.13 23-Mar-2021  rillig tests/lint: fix outdated comments
 1.12 20-Mar-2021  rillig tests/lint: add more tests for initialization, based on C99 6.7.8
 1.11 20-Mar-2021  rillig lint: fix assertion failure after error in designation

In d_c99_init.c, the initialization of array_with_designator failed.
The designator '.member' from that initialization was not cleaned up
before starting the next initialization.
 1.10 20-Mar-2021  rillig lint: replace segmentation fault with assertion failure
 1.9 19-Mar-2021  rillig lint: replace assertion in initialization with proper error message
 1.8 18-Mar-2021  rillig lint: replace undefined behavior during initialization with assertion

This only affects code that is already rejected by the compiler.
 1.7 18-Mar-2021  rillig tests/lint: add more examples for initialization
 1.6 21-Feb-2021  rillig lint: add debug logging for initializing an array of unknown size

It is possible that the type name 'array[unknown_size]' may spill into
the user-visible diagnostics. The current test suite does not cover
such a case. Anyway, saying 'array[unknown_size]' is still better than
saying 'array[0]', which would be misleading.
 1.5 21-Feb-2021  rillig lint: add test for initializing a character array using a string

The previous attempt took another code path than expected. The
initialization of static_duration actually calls initstack_string.
 1.4 21-Feb-2021  rillig lint: add more tests for C99 initialization
 1.3 21-Feb-2021  rillig lint: add another test case for initializing an object
 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 21-Feb-2021  rillig lint: add another test for C99 initializers
 1.31 17-Jun-2022  rillig 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'.
 1.30 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.29 28-Dec-2021  rillig tests/lint: extend documentation for omitted braces in initializer
 1.28 22-Dec-2021  rillig lint: fix handling of initializations

The implementation from March 2021 added proper support for designators
but didn't model the brace levels correctly. In particular, it could
not handle additional braces or omitted braces. In such a case, lint
skipped the remaining initializers from the initialization. Due to
this, type errors in the remaining initializers went unnoticed. Another
effect was that arrays of unknown size were wrongly reported as having
size 0.

Both GCC and Clang recommend placing braces around each sub-type that is
initialized, such as a struct, union or array. Postfix does not follow
these recommendations, therefore lint had to be disabled in
external/ibm-public/postfix/Makefile.inc. This commit fixes the bugs
mentioned there.
 1.27 17-Dec-2021  rillig tests/lint: add more examples for initialization, from C99
 1.26 09-Apr-2021  rillig lint: fix initialization with brace-enclosed string literal

C99 allows this form in 6.7.8p14 and p15.

The previous lint tests did not cover the case of an array at the top
level of the object to be initialized, they only covered the error cases
(d_c99_init.c, variables 'prefixed_message' and 'message_with_suffix').

Lint is now more generous than strictly required by C99, but since GCC
and Clang already cover the case of 'message_with_suffix', this is ok.

The test d_init_array_using_string.c was wrong before in rejecting the
initializer for 'extra_braces'. I had tested that Clang generated a
warning for this, but I had not inspected its warning carefully enough.
Clang had not warned about the extra braces but only about a type
mismatch since I tested on a platform where wchar_t was 16 bit.
 1.25 09-Apr-2021  rillig tests/lint: demonstrate wrong warning when initializing a string
 1.24 01-Apr-2021  rillig lint: do not error out of a struct is initialized without braces

This allows to process lib/libc/gen/sysctl.c 1.38 from 2021-03-30, as
well as its precedessor 1.37, which had a workaround just for lint.

While unusual, C99 allows these.
 1.23 30-Mar-2021  rillig tests/lint: test 'scalar type cannot use designator'
 1.22 30-Mar-2021  rillig tests/lint: remove unnecessary empty lines from test

In a separate commit to not cause an unnecessarily large diff in the
previous commit.
 1.21 30-Mar-2021  rillig lint: add error about out-of-bounds array subscripts

This check is not strictly necessary since any C99 compiler must
diagnose them as well, it is rather meant for demonstrating how to do
the check in lint, and for symmetry with the 'unknown member' error
message. These provide insight into how the data structures in init.c
are meant to be accessed.
 1.20 30-Mar-2021  rillig lint: add type information for message about unknown member name
 1.19 30-Mar-2021  rillig lint: reword message for very unlikely .member in array initialization
 1.18 30-Mar-2021  rillig tests/lint: remove outdated comments
 1.17 30-Mar-2021  rillig lint: rewrite handling of initializations, fixing several bugs

The previous implementation had a wrong model of how initialization
happens in C99, its assertions failed in all kind of edge cases and it
was not possible to fix the remaining bugs one at a time without running
into even more obscure assertion failures.

The debug logging was detailed but did not help to clarify the
situation. After about 20 failed attempts at fixing the small details I
decided to start all over and rewrite the initialization code from
scratch. I left the low-level parts of handling designators, the code
that is independent of brace_level and the high-level parts of how the
parser calls into this module. Everything else is completely new.

The concept of a brace level stays since that is how C99 describes
initialization. The previous code could not handle multi-level
designations (see d_init_pop_member.c). There are no more assertion
failures in the initialization code.

Some TODO comments have been left in the tests to keep the line numbers
the same in this commit. These will be cleaned up in a follow-up
commit.

The new implementation does not handle initialization with "missing"
braces. This is an edge case that both GCC and Clang warn about, so it
is not widely used. If necessary, it may be added later.

The new implementation does not use any global variables in the vast
majority of the functions, to make all dependencies and possible
modifications obvious.
 1.16 29-Mar-2021  rillig tests/lint: test unknown member name in struct

I had not expected to trigger another assertion, I just wanted to make
sure my latest ongoing refactoring will not break this case. Apparently
there is no need to worry about that.
 1.15 29-Mar-2021  rillig tests/lint: ensure initialization does not modify shared type

In my not yet published rewrite of lint's init.c, I forgot to copy the
array type. Guard against this bug, which would have been hard to find.

Given that in C, the declaration 'int a[], b[]' creates two different
type objects anyway, it's not easy to come up with a test case that
actually triggers this possible bug. I'm not sure whether this test
indeed catches this bug. If not, I'll add another test.
 1.14 28-Mar-2021  rillig tests/lint: add tests for initialization
 1.13 28-Mar-2021  rillig lint: remove wrong warning about wrong initializer type

The following code is valid:

int valid = {{{ 3 }}};

C90 3.5.7 and C99 6.7.8 both say that the "initializer for a scalar
shall be a single expression, optionally enclosed in braces". They
don't put any upper bound on the amount of braces, not even in the
"Translation limits" section.
 1.12 27-Mar-2021  rillig tests/lint: test initializing a struct ending with unnamed bit-field
 1.11 23-Mar-2021  rillig tests/lint: fix outdated comments
 1.10 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.9 20-Mar-2021  rillig lint: fix assertion failure after error in designation

In d_c99_init.c, the initialization of array_with_designator failed.
The designator '.member' from that initialization was not cleaned up
before starting the next initialization.
 1.8 19-Mar-2021  rillig lint: replace assertion in initialization with proper error message
 1.7 18-Mar-2021  rillig lint: reword message about type mismatch in initialization

Using parentheses for quotes is unusual, furthermore the previous
message didn't follow proper grammar rules, sacrificing clarity for
brevity.
 1.6 18-Mar-2021  rillig tests/lint: add more examples for initialization
 1.5 22-Feb-2021  rillig lint: change spelling of initialisation to initialization

That's the wording from the ISO C99 standard.
 1.4 21-Feb-2021  rillig lint: add test for initializing a character array using a string

The previous attempt took another code path than expected. The
initialization of static_duration actually calls initstack_string.
 1.3 21-Feb-2021  rillig lint: add more tests for C99 initialization
 1.2 21-Feb-2021  rillig lint: add another test case for initializing an object
 1.1 21-Feb-2021  rillig lint: add another test for C99 initializers
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 20-Feb-2021  rillig lint: clean up some of the C99 tests

Several C99 tests do not actually test C99 features but instead GCC
features. All these tests should be double-checked again.

In some other tests, split the initializers into more lines, which makes
it easier to read the debug log corresponding to these tests. This will
be necessary for reworking the initializer code to actually conform to
C99.
 1.3 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 20-Nov-2014  christos Add one more test
 1.6 05-Feb-2023  rillig tests/lint: merge tests for initialization
 1.5 20-Feb-2021  rillig lint: clean up some of the C99 tests

Several C99 tests do not actually test C99 features but instead GCC
features. All these tests should be double-checked again.

In some other tests, split the initializers into more lines, which makes
it easier to read the debug log corresponding to these tests. This will
be necessary for reworking the initializer code to actually conform to
C99.
 1.4 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.3 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.2 16-Jan-2021  rillig lint: normalize whitespace in tests
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_c99_recursive_init.c was added on branch yamt-pagecache on 2012-04-17 00:09:22 +0000
 1.6 08-Jun-2024  rillig tests/lint: group tests by topic
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 20-Feb-2021  rillig lint: clean up some of the C99 tests

Several C99 tests do not actually test C99 features but instead GCC
features. All these tests should be double-checked again.

In some other tests, split the initializers into more lines, which makes
it easier to read the debug log corresponding to these tests. This will
be necessary for reworking the initializer code to actually conform to
C99.
 1.3 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.2 16-Jan-2021  rillig lint: normalize whitespace in tests
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_c99_struct_init.c was added on branch yamt-pagecache on 2012-04-17 00:09:22 +0000
 1.8 07-Jul-2023  rillig 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.7 03-Aug-2021  rillig lint: union casts are only available as a GCC extension, not in C99
 1.6 03-Aug-2021  rillig tests/lint: prepare non-GCC test for union casts
 1.5 03-Aug-2021  rillig tests/lint: test GCC extension for casting to union type
 1.4 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.3 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 19-Aug-2016  christos branches: 1.1.2;
Add union cast test
 1.1.2.2 14-Sep-2016  pgoyette Sync with HEAD
 1.1.2.1 19-Aug-2016  pgoyette file d_c99_union_cast.c was added on branch pgoyette-localcount on 2016-09-14 03:04:19 +0000
 1.7 17-Jun-2022  rillig 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'.
 1.6 03-Aug-2021  rillig lint: union casts are only available as a GCC extension, not in C99
 1.5 03-Aug-2021  rillig tests/lint: prepare non-GCC test for union casts
 1.4 09-Apr-2021  rillig lint: quote placeholders in messages for unused variables
 1.3 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 28-Dec-2020  rillig lint1: add forgotten tests
 1.6 08-Jun-2024  rillig tests/lint: group tests by topic
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 20-Feb-2021  rillig lint: clean up some of the C99 tests

Several C99 tests do not actually test C99 features but instead GCC
features. All these tests should be double-checked again.

In some other tests, split the initializers into more lines, which makes
it easier to read the debug log corresponding to these tests. This will
be necessary for reworking the initializer code to actually conform to
C99.
 1.3 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.2 16-Jan-2021  rillig lint: normalize whitespace in tests
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_c99_union_init1.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.5 08-Jun-2024  rillig tests/lint: group tests by topic
 1.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.2 16-Jan-2021  rillig lint: normalize whitespace in tests
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_c99_union_init2.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.7 08-Jun-2024  rillig tests/lint: group tests by topic
 1.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 20-Feb-2021  rillig lint: clean up some of the C99 tests

Several C99 tests do not actually test C99 features but instead GCC
features. All these tests should be double-checked again.

In some other tests, split the initializers into more lines, which makes
it easier to read the debug log corresponding to these tests. This will
be necessary for reworking the initializer code to actually conform to
C99.
 1.4 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.3 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.2 16-Jan-2021  rillig lint: normalize whitespace in tests
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_c99_union_init3.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.5 08-Jun-2024  rillig tests/lint: group tests by topic
 1.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.2 16-Jan-2021  rillig lint: normalize whitespace in tests
 1.1 28-Jul-2015  christos new c99 init test found by xorg's Iconify.c
 1.3 08-Jun-2024  rillig tests/lint: group tests by topic
 1.2 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.1 28-Feb-2021  rillig lint: add test to demonstrate that PR bin/20264 has been fixed
 1.5 08-Jun-2024  rillig tests/lint: reorganize tests

Tests for a single working language construct don't usually need a
separate file, they can be grouped together, like in expr.c or gcc.c.
 1.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 20-Feb-2021  rillig lint: clean up some of the C99 tests

Several C99 tests do not actually test C99 features but instead GCC
features. All these tests should be double-checked again.

In some other tests, split the initializers into more lines, which makes
it easier to read the debug log corresponding to these tests. This will
be necessary for reworking the initializer code to actually conform to
C99.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_c9x_array_init.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.5 05-Feb-2023  rillig tests/lint: remove redundant tests

The names of the tests were misleading: 'recursive' should have been
'nested', and the interesting topic in the 'cast' tests was not the cast
but the pointer dereference.
 1.4 27-Feb-2022  rillig lint: C99 has been released, so refer to it by its proper name
 1.3 20-Feb-2021  rillig lint: clean up some of the C99 tests

Several C99 tests do not actually test C99 features but instead GCC
features. All these tests should be double-checked again.

In some other tests, split the initializers into more lines, which makes
it easier to read the debug log corresponding to these tests. This will
be necessary for reworking the initializer code to actually conform to
C99.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_c9x_recursive_init.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.4 07-Jul-2023  rillig 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.3 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 01-Jul-2015  christos new test.
 1.6 05-Feb-2023  rillig tests/lint: remove redundant tests

The names of the tests were misleading: 'recursive' should have been
'nested', and the interesting topic in the 'cast' tests was not the cast
but the pointer dereference.
 1.5 03-Jul-2021  rillig tests/lint: fix test d_cast_init on macppc

On macppc, char == unsigned, which generated the following unintended
warnings:

d_cast_init.c(18): warning: initialization of unsigned with negative
constant [221]
d_cast_init.c(18): warning: initialization of unsigned with negative
constant [221]
d_cast_init.c(18): warning: initialization of unsigned with negative
constant [221]
d_cast_init.c(18): warning: initialization of unsigned with negative
constant [221]
 1.4 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.3 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.2 16-Jan-2021  rillig lint: normalize whitespace in tests
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_cast_init.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.4 05-Feb-2023  rillig tests/lint: remove redundant tests

The names of the tests were misleading: 'recursive' should have been
'nested', and the interesting topic in the 'cast' tests was not the cast
but the pointer dereference.
 1.3 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_cast_init2.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.7 08-Jun-2024  rillig tests/lint: group tests by topic
 1.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 04-Jul-2021  rillig lint: remove remaining support for lvalue casts

These had been GCC extensions until GCC 3.4, they were removed in GCC
4.0.
 1.4 27-Mar-2021  rillig tests/lint: move description of tests into the tests themselves

In most cases the descriptions didn't add much to the test name anyway.
 1.3 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_cast_lhs.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.2 17-Jun-2022  rillig 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'.
 1.1 04-Jul-2021  rillig lint: remove remaining support for lvalue casts

These had been GCC extensions until GCC 3.4, they were removed in GCC
4.0.
 1.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.2 06-Mar-2017  christos branches: 1.2.2; 1.2.4;
add builtin_offsetof
 1.1 06-Mar-2017  christos add a test for a typeof cast
 1.2.4.2 21-Apr-2017  bouyer Sync with HEAD
 1.2.4.1 06-Mar-2017  bouyer file d_cast_typeof.c was added on branch bouyer-socketcan on 2017-04-21 16:54:13 +0000
 1.2.2.2 20-Mar-2017  pgoyette Sync with HEAD
 1.2.2.1 06-Mar-2017  pgoyette file d_cast_typeof.c was added on branch pgoyette-localcount on 2017-03-20 06:58:02 +0000
 1.6 08-Jun-2024  rillig tests/lint: group tests by topic
 1.5 07-Jul-2023  rillig 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.4 24-Apr-2022  rillig lint: error out on declarations with implicit int type
 1.3 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_compound_literals1.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.6 08-Jun-2024  rillig tests/lint: group tests by topic
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 24-Apr-2022  rillig lint: error out on declarations with implicit int type
 1.3 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_compound_literals2.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.7 08-Jun-2024  rillig tests/lint: group tests by topic
 1.6 08-Jun-2024  rillig lint: add details to warnings about negative constant to unsigned
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.3 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.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_constant_conv1.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.4 17-Jun-2022  rillig 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'.
 1.3 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 28-Dec-2020  rillig lint: for tests with output, ensure that the output matches
 1.8 08-Jun-2024  rillig tests/lint: group tests by topic
 1.7 09-Jul-2023  rillig lint: remove redundant '#' after 'argument' in diagnostics
 1.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 15-Apr-2022  rillig lint: in C99 mode, do not warn about non-prototype conversions

Message 259 is "argument #%d is converted from '%s' to '%s' due to
prototype", and it is intended to warn about compatibility between
traditional C where functions had no prototypes and standard C where
functions have prototypes.

Running lint in C99 mode is further away from traditional C than running
lint in C90 mode, so that warning doesn't make sense for C99. There are
still some inconsistencies in the 5 language version modes that lint
offers:

-t for traditional C
(no option) for migrating traditional C to C90
-s for C90 code
-S for C99 code
-Ac11 for C11 code

By disabling warning 259 in C99 mode, a typical NetBSD build produces
14.500 fewer warnings than before, of about 100.000 total.

Message 259 overlaps with message 298 "conversion from '%s' to '%s' may
lose accuracy, arg #%d", and in some cases of potentially lossy
conversions, lint now produces none of these messages. In some other
cases, these warnings were reported redundantly. The cases where
message 298 makes sense will be added back later, as needed.
 1.4 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.3 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.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_constant_conv2.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.8 17-Jun-2022  rillig 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'.
 1.7 15-Apr-2022  rillig lint: in C99 mode, do not warn about non-prototype conversions

Message 259 is "argument #%d is converted from '%s' to '%s' due to
prototype", and it is intended to warn about compatibility between
traditional C where functions had no prototypes and standard C where
functions have prototypes.

Running lint in C99 mode is further away from traditional C than running
lint in C90 mode, so that warning doesn't make sense for C99. There are
still some inconsistencies in the 5 language version modes that lint
offers:

-t for traditional C
(no option) for migrating traditional C to C90
-s for C90 code
-S for C99 code
-Ac11 for C11 code

By disabling warning 259 in C99 mode, a typical NetBSD build produces
14.500 fewer warnings than before, of about 100.000 total.

Message 259 overlaps with message 298 "conversion from '%s' to '%s' may
lose accuracy, arg #%d", and in some cases of potentially lossy
conversions, lint now produces none of these messages. In some other
cases, these warnings were reported redundantly. The cases where
message 298 makes sense will be added back later, as needed.
 1.6 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.5 04-Feb-2021  rillig lint: add back "due to prototype" to message 259

That message is only supposed to warn about compatibility to traditional
C, in case the function should ever be compiled without its prototype
being in effect. All other type checks are supposed to be in another
function, as documented, but that type check misses to report a few
error-prone type combinations (long to char, long to int).

30 years after the introduction of prototypes with C90, almost all
existing code uses prototypes. The warning has thus lost most of its
usefulness and can rather be confusing since a conversion from 'char' to
'long' is not problematic with prototypes in action, and the probability
of the code being backported to a pre-C90 compiler is diminishingly
small.

The words "due to prototype" now serve as a hint again. The proper fix
could be to suppress this warning in C99 mode since that's far enough
from traditional C.
 1.4 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.3 31-Jan-2021  rillig lint: reword message 259 about function argument conversion

The words "due to prototype" are an anachronism from the 1990s.
Nowadays every function is defined using a prototype, which makes these
words redundant.
 1.2 31-Jan-2021  rillig lint: make warning about function argument conversion more detailed

For every conversion it is useful to know both the source and the target
type since these are not always obvious from the code.

The only surprise is the warning in d_gcc_extension. The conversion
there is from 'double' to 'long double', which is a lossless conversion.
This may be a bug in lint.
 1.1 28-Dec-2020  rillig lint: for tests with output, ensure that the output matches
 1.7 08-Jun-2024  rillig tests/lint: reorganize tests

Tests for a single working language construct don't usually need a
separate file, they can be grouped together, like in expr.c or gcc.c.
 1.6 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.5 21-Feb-2021  rillig lint: fix wrong warning about main falling off the bottom in C99 mode

This gets lint a small step closer to implementing C99.
 1.4 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.3 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Apr-2014  christos branches: 1.1.2; 1.1.4; 1.1.8;
add more tests
 1.1.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.8.1 17-Apr-2014  tls file d_cvt_constant.c was added on branch tls-maxphys on 2014-08-20 00:04:53 +0000
 1.1.4.2 10-Aug-2014  tls Rebase.
 1.1.4.1 17-Apr-2014  tls file d_cvt_constant.c was added on branch tls-earlyentropy on 2014-08-10 06:57:37 +0000
 1.1.2.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.2.1 17-Apr-2014  yamt file d_cvt_constant.c was added on branch yamt-pagecache on 2014-05-22 11:42:24 +0000
 1.7 17-Jun-2022  rillig 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'.
 1.6 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.5 09-Apr-2021  rillig lint: quote placeholders in messages for unused variables
 1.4 21-Feb-2021  rillig lint: fix wrong warning about main falling off the bottom in C99 mode

This gets lint a small step closer to implementing C99.
 1.3 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 28-Dec-2020  rillig lint1: enable test cvt_constant

This test had never been enabled. In t_integration.sh 1.3 from
2014-04-17 it was supposed to be enabled, but due to a line continuation
backslash, the words "test_case check_valid" ended up as the description
of the previous test, cvt_in_ternary.

While here, add the expected test output for d_struct_init_nested to
FILES.
 1.4 08-Jun-2024  rillig tests/lint: reorganize tests

Tests for a single working language construct don't usually need a
separate file, they can be grouped together, like in expr.c or gcc.c.
 1.3 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_cvt_in_ternary.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.11 03-Jan-2025  rillig lint: add detail to message about obsolete identifier list
 1.10 01-Dec-2024  rillig lint: warn about function definitions that still use identifier lists
 1.9 02-Aug-2023  rillig branches: 1.9.2;
lint: distinguish between arguments and parameters
 1.8 09-Jul-2023  rillig lint: clean up wording in diagnostics

Use the term 'parameter' as defined in C99 3.15.
 1.7 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.6 01-Oct-2022  rillig lint: add hyphen to adjective 'old-style'
 1.5 20-Jun-2022  rillig lint: add quotes around several placeholders in messages
 1.4 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.3 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 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 30-Dec-2020  rillig lint: add test for old style function arguments
 1.9.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.3 09-Apr-2021  rillig lint: quote placeholders in messages for unused variables
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.1 30-Dec-2020  rillig lint: add test for old style function arguments
 1.6 08-Jun-2024  rillig tests/lint: reorganize tests

Tests for a single working language construct don't usually need a
separate file, they can be grouped together, like in expr.c or gcc.c.
 1.5 07-Jul-2023  rillig 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.4 27-Mar-2021  rillig tests/lint: move description of tests into the tests themselves

In most cases the descriptions didn't add much to the test name anyway.
 1.3 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_ellipsis_in_switch.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.8 06-Aug-2023  rillig lint: since C99, a non-void function must return a value
 1.7 09-Jul-2023  rillig lint: clean up wording in diagnostics

Use the term 'parameter' as defined in C99 3.15.
 1.6 07-Jul-2023  rillig 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.5 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.4 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.3 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.2 08-Jan-2021  rillig lint: fix function as controlling expression (since 2020-12-31)

It's perfectly valid to directly use a function name as the controlling
expression of an if statement. That function name is converted
implicitly to a pointer to that function, and that is a scalar value
then.

Spotted by christos in lib/libpthread/pthread.c:634.
 1.1 31-Dec-2020  rillig lint: check that in "if (cond)", cond is scalar
 1.7 17-Jun-2022  rillig 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'.
 1.6 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.5 03-Aug-2021  rillig lint: add quotes around placeholder in message 214

function '%s' expects to return value
 1.4 09-Apr-2021  rillig lint: quote placeholders in messages for unused variables
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 08-Jan-2021  rillig lint: fix function as controlling expression (since 2020-12-31)

It's perfectly valid to directly use a function name as the controlling
expression of an if statement. That function name is converted
implicitly to a pointer to that function, and that is a scalar value
then.

Spotted by christos in lib/libpthread/pthread.c:634.
 1.1 31-Dec-2020  rillig lint: check that in "if (cond)", cond is scalar
 1.14 02-Jul-2023  rillig lint: allow empty statements in GCC statement expressions
 1.13 02-Jul-2023  rillig tests/lint: demonstrate empty statement in GCC statement expression

Seen in external/mit/xorg/lib/dri.old.
 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 15-Jun-2022  rillig lint: clean up an empty line and the documentation

No functional change.
 1.10 31-May-2022  rillig lint: fix null pointer dereference after syntax error

Found by afl, starting with the malformed input '/**/f=({;/**/};}' that
no longer crashes. This input led to 'f=({L:;}', which is at least a
syntactically valid prefix of a translation unit, containing a GCC
statement expression with an unused label. The error message for this
unused label assumed that it would always be inside a function
definition.

While here, document incomplete recovery after syntax errors, in
msg_249.c.
 1.9 24-Apr-2022  rillig lint: error out on declarations with implicit int type
 1.8 03-Apr-2022  rillig lint: fix crash after syntax error in GCC statement expression

Since cgram.y 1.226 from 2021-05-03.
 1.7 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.6 20-Jun-2021  rillig lint: fix crash on semantically wrong code in ({...})

Found by afl.
 1.5 19-Jun-2021  rillig lint: fix crash in malformed initialization
 1.4 27-Mar-2021  rillig tests/lint: move description of tests into the tests themselves

In most cases the descriptions didn't add much to the test name anyway.
 1.3 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_gcc_compound_statements1.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.6 17-Jun-2022  rillig 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'.
 1.5 31-May-2022  rillig lint: fix null pointer dereference after syntax error

Found by afl, starting with the malformed input '/**/f=({;/**/};}' that
no longer crashes. This input led to 'f=({L:;}', which is at least a
syntactically valid prefix of a translation unit, containing a GCC
statement expression with an unused label. The error message for this
unused label assumed that it would always be inside a function
definition.

While here, document incomplete recovery after syntax errors, in
msg_249.c.
 1.4 03-Apr-2022  rillig lint: fix crash after syntax error in GCC statement expression

Since cgram.y 1.226 from 2021-05-03.
 1.3 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.2 20-Jun-2021  rillig lint: fix crash on semantically wrong code in ({...})

Found by afl.
 1.1 19-Jun-2021  rillig lint: fix crash in malformed initialization
 1.6 07-Jul-2023  rillig 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.5 26-Feb-2022  rillig lint: fix memory corruption in statement expressions (since 2021-12-17)

The commit that introduced the assertion failure looks innocent, it only
adds a few predefined functions for GCC mode. Nevertheless, before that
commit, lint consistently complained about 'error: void type illegal in
expression [109]', which doesn't make sense either.

This fix also removes the creative use of the initialization stack to
store the type of the statement expression. Having a separate stack for
these statement expressions makes the code easier to understand.
 1.4 10-Sep-2021  rillig lint: replace space followed by tab with simply tab

No functional change.
 1.3 23-Apr-2021  rillig tests/lint: test GCC compound expression without declaration
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_gcc_compound_statements2.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_gcc_compound_statements3.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.8 08-Jun-2024  rillig tests/lint: reorganize tests

Tests for a single working language construct don't usually need a
separate file, they can be grouped together, like in expr.c or gcc.c.
 1.7 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.6 25-May-2021  rillig tests/lint: make test d_gcc_extension platform-independent

That test was intended to test the keywords '__extension__' and
'__typeof'. The GCC builtin functions were just a side-effect.

These built-in functions generated error messages on platforms such as
amd64 where sizeof(long double) != sizeof(double), but not on others
such as sparc.

The current infrastructure for the lint tests cannot handle tests with
platform-dependent outcome.
 1.5 05-Apr-2021  rillig branches: 1.5.2;
tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.4 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.3 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Apr-2014  christos branches: 1.1.2; 1.1.4; 1.1.8;
add more tests
 1.1.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.8.1 17-Apr-2014  tls file d_gcc_extension.c was added on branch tls-maxphys on 2014-08-20 00:04:53 +0000
 1.1.4.2 10-Aug-2014  tls Rebase.
 1.1.4.1 17-Apr-2014  tls file d_gcc_extension.c was added on branch tls-earlyentropy on 2014-08-10 06:57:37 +0000
 1.1.2.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.2.1 17-Apr-2014  yamt file d_gcc_extension.c was added on branch yamt-pagecache on 2014-05-22 11:42:24 +0000
 1.5.2.1 31-May-2021  cjep sync with head
 1.7 25-May-2021  rillig tests/lint: make test d_gcc_extension platform-independent

That test was intended to test the keywords '__extension__' and
'__typeof'. The GCC builtin functions were just a side-effect.

These built-in functions generated error messages on platforms such as
amd64 where sizeof(long double) != sizeof(double), but not on others
such as sparc.

The current infrastructure for the lint tests cannot handle tests with
platform-dependent outcome.
 1.6 04-Feb-2021  rillig branches: 1.6.2;
lint: add back "due to prototype" to message 259

That message is only supposed to warn about compatibility to traditional
C, in case the function should ever be compiled without its prototype
being in effect. All other type checks are supposed to be in another
function, as documented, but that type check misses to report a few
error-prone type combinations (long to char, long to int).

30 years after the introduction of prototypes with C90, almost all
existing code uses prototypes. The warning has thus lost most of its
usefulness and can rather be confusing since a conversion from 'char' to
'long' is not problematic with prototypes in action, and the probability
of the code being backported to a pre-C90 compiler is diminishingly
small.

The words "due to prototype" now serve as a hint again. The proper fix
could be to suppress this warning in C99 mode since that's far enough
from traditional C.
 1.5 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.4 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.3 31-Jan-2021  rillig lint: reword message 259 about function argument conversion

The words "due to prototype" are an anachronism from the 1990s.
Nowadays every function is defined using a prototype, which makes these
words redundant.
 1.2 31-Jan-2021  rillig lint: make warning about function argument conversion more detailed

For every conversion it is useful to know both the source and the target
type since these are not always obvious from the code.

The only surprise is the warning in d_gcc_extension. The conversion
there is from 'double' to 'long double', which is a lossless conversion.
This may be a bug in lint.
 1.1 28-Dec-2020  rillig lint1: add forgotten tests
 1.6.2.1 31-May-2021  cjep sync with head
 1.5 08-Jun-2024  rillig tests/lint: reorganize tests

Tests for a single working language construct don't usually need a
separate file, they can be grouped together, like in expr.c or gcc.c.
 1.4 07-Jul-2023  rillig 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.3 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_gcc_func.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.5 08-Jun-2024  rillig tests/lint: group tests by topic
 1.4 07-Jul-2023  rillig 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.3 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_gcc_variable_array_init.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.5 08-Jun-2024  rillig tests/lint: reorganize tests

Tests for a single working language construct don't usually need a
separate file, they can be grouped together, like in expr.c or gcc.c.
 1.4 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.3 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.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_incorrect_array_size.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.5 17-Jun-2022  rillig 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'.
 1.4 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 28-Dec-2020  rillig lint: for tests with output, ensure that the output matches
 1.15 08-Jun-2024  rillig tests/lint: group tests by topic
 1.14 07-Jul-2023  rillig lint: only skip 'unused' warnings after errors, not other warnings

Previously, in -w mode, any warning suppressed further 'unused'
warnings, even though there was no need to do that. This can be seen in
the test gcc_attribute_var.c, where only the last unused variable from a
function was marked as unused, the others slipped through.

Fixed by counting the errors and the warnings separately and only
combining them if actually desired.
 1.13 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.12 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.11 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.10 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.9 22-Dec-2021  rillig tests/lint: fix space-tab indentation
 1.8 22-Dec-2021  rillig lint: fix handling of initializations

The implementation from March 2021 added proper support for designators
but didn't model the brace levels correctly. In particular, it could
not handle additional braces or omitted braces. In such a case, lint
skipped the remaining initializers from the initialization. Due to
this, type errors in the remaining initializers went unnoticed. Another
effect was that arrays of unknown size were wrongly reported as having
size 0.

Both GCC and Clang recommend placing braces around each sub-type that is
initialized, such as a struct, union or array. Postfix does not follow
these recommendations, therefore lint had to be disabled in
external/ibm-public/postfix/Makefile.inc. This commit fixes the bugs
mentioned there.
 1.7 21-Dec-2021  rillig lint: reword message 187 about too long string literal for initializer

The previous message was imprecise in that it didn't distinguish between
non-terminating and terminating null bytes.
 1.6 10-Sep-2021  rillig lint: replace space followed by tab with simply tab

No functional change.
 1.5 14-Aug-2021  rillig lint: use standard quoting style for messages 124 and 184
 1.4 09-Apr-2021  rillig lint: fix initialization with brace-enclosed string literal

C99 allows this form in 6.7.8p14 and p15.

The previous lint tests did not cover the case of an array at the top
level of the object to be initialized, they only covered the error cases
(d_c99_init.c, variables 'prefixed_message' and 'message_with_suffix').

Lint is now more generous than strictly required by C99, but since GCC
and Clang already cover the case of 'message_with_suffix', this is ok.

The test d_init_array_using_string.c was wrong before in rejecting the
initializer for 'extra_braces'. I had tested that Clang generated a
warning for this, but I had not inspected its warning carefully enough.
Clang had not warned about the extra braces but only about a type
mismatch since I tested on a platform where wchar_t was 16 bit.
 1.3 30-Mar-2021  rillig lint: rewrite handling of initializations, fixing several bugs

The previous implementation had a wrong model of how initialization
happens in C99, its assertions failed in all kind of edge cases and it
was not possible to fix the remaining bugs one at a time without running
into even more obscure assertion failures.

The debug logging was detailed but did not help to clarify the
situation. After about 20 failed attempts at fixing the small details I
decided to start all over and rewrite the initialization code from
scratch. I left the low-level parts of handling designators, the code
that is independent of brace_level and the high-level parts of how the
parser calls into this module. Everything else is completely new.

The concept of a brace level stays since that is how C99 describes
initialization. The previous code could not handle multi-level
designations (see d_init_pop_member.c). There are no more assertion
failures in the initialization code.

Some TODO comments have been left in the tests to keep the line numbers
the same in this commit. These will be cleaned up in a follow-up
commit.

The new implementation does not handle initialization with "missing"
braces. This is an edge case that both GCC and Clang warn about, so it
is not widely used. If necessary, it may be added later.

The new implementation does not use any global variables in the vast
majority of the functions, to make all dependencies and possible
modifications obvious.
 1.2 23-Mar-2021  rillig lint: fix wrong warning about initialization using string literal

Missing braces after 'if', since init.c 1.68 from 2021-02-20.

GCC 10 doesn't complain about this even with -Wmisleading-indentation
since at least one of the involved lines is a macro invocation (in this
case both lines). GCC 11 will warn about this.

Clang warns about this, but the regular Clang build currently fails for
other reasons, so this problem didn't show up there either.
 1.1 23-Mar-2021  rillig tests/lint: test initialization using string literals

The errors in line 74 and 75 of the test are wrong. Everything is fine
there. The bug lies in init_array_using_string, try to see if you can
spot it, neither GCC 9.3.0 nor Clang 8.0.1 could.
 1.10 17-Jun-2022  rillig 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'.
 1.9 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.8 22-Dec-2021  rillig lint: fix handling of initializations

The implementation from March 2021 added proper support for designators
but didn't model the brace levels correctly. In particular, it could
not handle additional braces or omitted braces. In such a case, lint
skipped the remaining initializers from the initialization. Due to
this, type errors in the remaining initializers went unnoticed. Another
effect was that arrays of unknown size were wrongly reported as having
size 0.

Both GCC and Clang recommend placing braces around each sub-type that is
initialized, such as a struct, union or array. Postfix does not follow
these recommendations, therefore lint had to be disabled in
external/ibm-public/postfix/Makefile.inc. This commit fixes the bugs
mentioned there.
 1.7 21-Dec-2021  rillig lint: reword message 187 about too long string literal for initializer

The previous message was imprecise in that it didn't distinguish between
non-terminating and terminating null bytes.
 1.6 14-Aug-2021  rillig lint: use standard quoting style for messages 124 and 184
 1.5 14-Aug-2021  rillig lint: allow initialization of struct with constant member

The operator INIT, just like RETURN and FARG, initializes an object with
an expression. The target object of such an initialization may be a
struct with constant members.

The operator ASSIGN, on the other hand, is entirely different. It
overwrites the existing value of the object, and this is not allowed for
structs that have a constant member. Therefore it was wrong to use the
operator ASSIGN for initialization.
 1.4 09-Apr-2021  rillig lint: fix initialization with brace-enclosed string literal

C99 allows this form in 6.7.8p14 and p15.

The previous lint tests did not cover the case of an array at the top
level of the object to be initialized, they only covered the error cases
(d_c99_init.c, variables 'prefixed_message' and 'message_with_suffix').

Lint is now more generous than strictly required by C99, but since GCC
and Clang already cover the case of 'message_with_suffix', this is ok.

The test d_init_array_using_string.c was wrong before in rejecting the
initializer for 'extra_braces'. I had tested that Clang generated a
warning for this, but I had not inspected its warning carefully enough.
Clang had not warned about the extra braces but only about a type
mismatch since I tested on a platform where wchar_t was 16 bit.
 1.3 30-Mar-2021  rillig lint: rewrite handling of initializations, fixing several bugs

The previous implementation had a wrong model of how initialization
happens in C99, its assertions failed in all kind of edge cases and it
was not possible to fix the remaining bugs one at a time without running
into even more obscure assertion failures.

The debug logging was detailed but did not help to clarify the
situation. After about 20 failed attempts at fixing the small details I
decided to start all over and rewrite the initialization code from
scratch. I left the low-level parts of handling designators, the code
that is independent of brace_level and the high-level parts of how the
parser calls into this module. Everything else is completely new.

The concept of a brace level stays since that is how C99 describes
initialization. The previous code could not handle multi-level
designations (see d_init_pop_member.c). There are no more assertion
failures in the initialization code.

Some TODO comments have been left in the tests to keep the line numbers
the same in this commit. These will be cleaned up in a follow-up
commit.

The new implementation does not handle initialization with "missing"
braces. This is an edge case that both GCC and Clang warn about, so it
is not widely used. If necessary, it may be added later.

The new implementation does not use any global variables in the vast
majority of the functions, to make all dependencies and possible
modifications obvious.
 1.2 23-Mar-2021  rillig lint: fix wrong warning about initialization using string literal

Missing braces after 'if', since init.c 1.68 from 2021-02-20.

GCC 10 doesn't complain about this even with -Wmisleading-indentation
since at least one of the involved lines is a macro invocation (in this
case both lines). GCC 11 will warn about this.

Clang warns about this, but the regular Clang build currently fails for
other reasons, so this problem didn't show up there either.
 1.1 23-Mar-2021  rillig tests/lint: test initialization using string literals

The errors in line 74 and 75 of the test are wrong. Everything is fine
there. The bug lies in init_array_using_string, try to see if you can
spot it, neither GCC 9.3.0 nor Clang 8.0.1 could.
 1.11 08-Jun-2024  rillig tests/lint: group tests by topic
 1.10 07-Jul-2023  rillig 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.9 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.8 20-Jun-2021  rillig tests/lint: document disappearance of bug in pop_member
 1.7 30-Mar-2021  rillig lint: rewrite handling of initializations, fixing several bugs

The previous implementation had a wrong model of how initialization
happens in C99, its assertions failed in all kind of edge cases and it
was not possible to fix the remaining bugs one at a time without running
into even more obscure assertion failures.

The debug logging was detailed but did not help to clarify the
situation. After about 20 failed attempts at fixing the small details I
decided to start all over and rewrite the initialization code from
scratch. I left the low-level parts of handling designators, the code
that is independent of brace_level and the high-level parts of how the
parser calls into this module. Everything else is completely new.

The concept of a brace level stays since that is how C99 describes
initialization. The previous code could not handle multi-level
designations (see d_init_pop_member.c). There are no more assertion
failures in the initialization code.

Some TODO comments have been left in the tests to keep the line numbers
the same in this commit. These will be cleaned up in a follow-up
commit.

The new implementation does not handle initialization with "missing"
braces. This is an edge case that both GCC and Clang warn about, so it
is not widely used. If necessary, it may be added later.

The new implementation does not use any global variables in the vast
majority of the functions, to make all dependencies and possible
modifications obvious.
 1.6 19-Mar-2021  rillig tests/lint: add comma to struct initialization

This places the error marker one line up, where it is expected.
 1.5 20-Feb-2021  rillig lint: add machine-readable expectations to test for initializer
 1.4 20-Feb-2021  rillig lint: fix typo in test for pop_member

The leader of a city should rather be a mayor than a major.
 1.3 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.2 01-Jan-2021  rillig lint: fix wrong warning about bitfield in C99 structure initialization

The variable namemem is supposed to be a circular list, which is
"documented" implicitly in push_member.

The implementation was buggy though. In pop_member, the circular list
was destroyed though. Given the list (capital, major, favorite_color,
green), removing capital made major point to itself in the forward
direction, even though it should not have been modified at all.

In the test, I had been too optimistic to quickly understand the code
around variable initialization. I was wrong though, so I had to adjust
the comments there to reality.
 1.1 01-Jan-2021  rillig lint: demonstrate bug in handling of nested C9X struct initializers
 1.9 17-Jun-2022  rillig 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'.
 1.8 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.7 09-Apr-2021  rillig lint: quote placeholders in messages for unused variables
 1.6 30-Mar-2021  rillig lint: rewrite handling of initializations, fixing several bugs

The previous implementation had a wrong model of how initialization
happens in C99, its assertions failed in all kind of edge cases and it
was not possible to fix the remaining bugs one at a time without running
into even more obscure assertion failures.

The debug logging was detailed but did not help to clarify the
situation. After about 20 failed attempts at fixing the small details I
decided to start all over and rewrite the initialization code from
scratch. I left the low-level parts of handling designators, the code
that is independent of brace_level and the high-level parts of how the
parser calls into this module. Everything else is completely new.

The concept of a brace level stays since that is how C99 describes
initialization. The previous code could not handle multi-level
designations (see d_init_pop_member.c). There are no more assertion
failures in the initialization code.

Some TODO comments have been left in the tests to keep the line numbers
the same in this commit. These will be cleaned up in a follow-up
commit.

The new implementation does not handle initialization with "missing"
braces. This is an edge case that both GCC and Clang warn about, so it
is not widely used. If necessary, it may be added later.

The new implementation does not use any global variables in the vast
majority of the functions, to make all dependencies and possible
modifications obvious.
 1.5 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.4 19-Mar-2021  rillig tests/lint: add comma to struct initialization

This places the error marker one line up, where it is expected.
 1.3 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.2 01-Jan-2021  rillig lint: fix wrong warning about bitfield in C99 structure initialization

The variable namemem is supposed to be a circular list, which is
"documented" implicitly in push_member.

The implementation was buggy though. In pop_member, the circular list
was destroyed though. Given the list (capital, major, favorite_color,
green), removing capital made major point to itself in the forward
direction, even though it should not have been modified at all.

In the test, I had been too optimistic to quickly understand the code
around variable initialization. I was wrong though, so I had to adjust
the comments there to reality.
 1.1 01-Jan-2021  rillig lint: demonstrate bug in handling of nested C9X struct initializers
 1.10 02-Aug-2023  rillig lint: distinguish between arguments and parameters
 1.9 15-Jul-2023  rillig tests/lint: document how to reliably crash lint1 after a parse error
 1.8 15-Jul-2023  rillig lint: add debug logging for memory management and the symbol table
 1.7 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.6 01-Oct-2022  rillig lint: add hyphen to adjective 'old-style'
 1.5 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.4 10-Jul-2021  rillig lint: fix assertion failure in declare_argument
 1.3 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.2 10-Jan-2021  rillig lint: fix assertion failure for syntax error in enum declaration
 1.1 10-Jan-2021  rillig lint: add test for triggering assertion failures in lint1
 1.6 17-Jun-2022  rillig 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'.
 1.5 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.4 10-Jul-2021  rillig lint: fix assertion failure in declare_argument
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 10-Jan-2021  rillig lint: fix assertion failure for syntax error in enum declaration
 1.1 10-Jan-2021  rillig lint: add test for triggering assertion failures in lint1
 1.7 08-Jun-2024  rillig tests/lint: reorganize tests

Tests for a single working language construct don't usually need a
separate file, they can be grouped together, like in expr.c or gcc.c.
 1.6 07-Jul-2023  rillig 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.5 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.4 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.3 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.2 25-Jun-2020  jruoho Reference PRs consistently.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_long_double_int.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.7 17-Jun-2022  rillig 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'.
 1.6 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.5 14-Aug-2021  rillig lint: use standard quoting style for messages 124 and 184
 1.4 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.3 05-Jan-2021  rillig lint: clean up symbolic operator names that are used in the messages

Including the "p" in the symbolic operator names was questionable, for
several reasons:

1. The "p" could be taken to mean an actual variable name, which is
confusing if the function doesn't have such a variable, or even more
so if the line contains an unrelated variable called "p".

2. For the binary operators, having the "p" mentioned on both sides of
the operator (such as in "p + p") wrongly suggested that both
operands of the expression were the same.

3. The name "p" often stands for a pointer. Most of the operators
don't accept pointers, therefore the name was misleading.

For these reasons, the "p" was removed from the symbolic name of all
operators. This makes several pairs of operators indistinguishable:

INCBEF == INCAFT
DECBEF == DECAFT
UPLUS == PLUS
UMINUS == MINUS
STAR == MULT
AMPER == AND

This is not expected to create any confusion since C programmers are
expected to know these double meanings.

The symbolic names for SHLASS and SHRASS were missing the '=' before.
This was added since omitting it was probably an oversight.
 1.2 03-Jan-2021  rillig lint: add type information to message 124 "illegal pointer combination"
 1.1 28-Dec-2020  rillig lint: for tests with output, ensure that the output matches
 1.5 08-Jun-2024  rillig tests/lint: group tests by topic
 1.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_nested_structs.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.4 05-Feb-2023  rillig tests/lint: merge tests for initialization
 1.3 27-Mar-2021  rillig tests/lint: move description of tests into the tests themselves

In most cases the descriptions didn't add much to the test name anyway.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_nolimit_init.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.6 05-Aug-2023  rillig tests/lint: fix test for packed structs on 32-bit platforms
 1.5 01-Aug-2023  rillig tests/lint: test packed and in-parameter declarations
 1.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_packed_structs.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.6 08-Jun-2024  rillig tests/lint: group tests by topic
 1.5 07-Jul-2023  rillig 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.4 01-Apr-2022  rillig lint: improve determination of abstract typename

Still not perfect, but at least a step in the right direction. See
decl_direct_abstract.c for the missing edge cases.

See PR#22119.
 1.3 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.2 26-Mar-2021  rillig lint: add quotes around placeholder in message about undefined variable

Before: error: expected undefined [99]
After: error: 'expected' undefined [99]

Seen in external/mpl/bind, which for Clang defines in stdatomic.h:
> #define atomic_exchange_explicit(obj, desired, order) \
> __c11_atomic_exchange_explicit(obj, expected, order)
Note the mismatch between 'desired' and 'expected'.
 1.1 28-Feb-2021  rillig lint: fix null pointer dereference on parse error

Fixes PR bin/22119.
 1.6 17-Jun-2022  rillig 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'.
 1.5 01-Apr-2022  rillig lint: improve determination of abstract typename

Still not perfect, but at least a step in the right direction. See
decl_direct_abstract.c for the missing edge cases.

See PR#22119.
 1.4 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.3 26-Mar-2021  rillig lint: add quotes around placeholder in message about undefined variable

Before: error: expected undefined [99]
After: error: 'expected' undefined [99]

Seen in external/mpl/bind, which for Clang defines in stdatomic.h:
> #define atomic_exchange_explicit(obj, desired, order) \
> __c11_atomic_exchange_explicit(obj, expected, order)
Note the mismatch between 'desired' and 'expected'.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.1 28-Feb-2021  rillig lint: fix null pointer dereference on parse error

Fixes PR bin/22119.
 1.7 08-Jun-2024  rillig tests/lint: reorganize tests

Tests for a single working language construct don't usually need a
separate file, they can be grouped together, like in expr.c or gcc.c.
 1.6 07-Jul-2023  rillig 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.5 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.4 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.3 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.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 01-Jan-2021  rillig lint: fix segmentation fault when checking returned enum types (211)
 1.4 17-Jun-2022  rillig 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'.
 1.3 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 01-Jan-2021  rillig lint: fix segmentation fault when checking returned enum types (211)
 1.4 29-Jan-2023  rillig tests/lint: merge tests for '>>'
 1.3 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_shift_to_narrower_type.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.9 08-Jun-2024  rillig tests/lint: group tests by topic
 1.8 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.7 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.6 25-Mar-2021  rillig lint: fix C99 initialization with expression of type 'struct'

This has been a long-standing limitation of lint. Now it is almost
ready for C99, see the list of "major changes" in the foreword of C99.

One known remaining bug in the area of initialization is designators
with several levels, such as '.member[2].member.member'. Oh, and
designators for arrays are only supported in the parser but not in the
type checker. There's still some work to do.
 1.5 18-Mar-2021  rillig tests/lint: warning 210 has type information by now
 1.4 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.3 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.2 30-Dec-2020  rillig lint: document purpose of the test d_struct_init_nested
 1.1 28-Dec-2020  rillig lint1: add test for initializing nested structs

Discovered in var.c 1.774 from 2020-12-28.
 1.10 17-Jun-2022  rillig 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'.
 1.9 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.8 25-Mar-2021  rillig lint: fix C99 initialization with expression of type 'struct'

This has been a long-standing limitation of lint. Now it is almost
ready for C99, see the list of "major changes" in the foreword of C99.

One known remaining bug in the area of initialization is designators
with several levels, such as '.member[2].member.member'. Oh, and
designators for arrays are only supported in the parser but not in the
type checker. There's still some work to do.
 1.7 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.6 18-Mar-2021  rillig lint: reword message about type mismatch in initialization

Using parentheses for quotes is unusual, furthermore the previous
message didn't follow proper grammar rules, sacrificing clarity for
brevity.
 1.5 22-Feb-2021  rillig lint: change spelling of initialisation to initialization

That's the wording from the ISO C99 standard.
 1.4 21-Feb-2021  rillig lint: add type information to message about enum mismatch
 1.3 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.2 30-Dec-2020  rillig lint: document purpose of the test d_struct_init_nested
 1.1 28-Dec-2020  rillig lint1: add expected output for test d_struct_init_nested
 1.8 08-Jun-2024  rillig tests/lint: group tests by topic
 1.7 09-Jul-2023  rillig lint: remove redundant '#' after 'argument' in diagnostics
 1.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 15-Apr-2022  rillig lint: in C99 mode, do not warn about non-prototype conversions

Message 259 is "argument #%d is converted from '%s' to '%s' due to
prototype", and it is intended to warn about compatibility between
traditional C where functions had no prototypes and standard C where
functions have prototypes.

Running lint in C99 mode is further away from traditional C than running
lint in C90 mode, so that warning doesn't make sense for C99. There are
still some inconsistencies in the 5 language version modes that lint
offers:

-t for traditional C
(no option) for migrating traditional C to C90
-s for C90 code
-S for C99 code
-Ac11 for C11 code

By disabling warning 259 in C99 mode, a typical NetBSD build produces
14.500 fewer warnings than before, of about 100.000 total.

Message 259 overlaps with message 298 "conversion from '%s' to '%s' may
lose accuracy, arg #%d", and in some cases of potentially lossy
conversions, lint now produces none of these messages. In some other
cases, these warnings were reported redundantly. The cases where
message 298 makes sense will be added back later, as needed.
 1.4 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.3 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.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_type_conv1.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.8 17-Jun-2022  rillig 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'.
 1.7 15-Apr-2022  rillig lint: in C99 mode, do not warn about non-prototype conversions

Message 259 is "argument #%d is converted from '%s' to '%s' due to
prototype", and it is intended to warn about compatibility between
traditional C where functions had no prototypes and standard C where
functions have prototypes.

Running lint in C99 mode is further away from traditional C than running
lint in C90 mode, so that warning doesn't make sense for C99. There are
still some inconsistencies in the 5 language version modes that lint
offers:

-t for traditional C
(no option) for migrating traditional C to C90
-s for C90 code
-S for C99 code
-Ac11 for C11 code

By disabling warning 259 in C99 mode, a typical NetBSD build produces
14.500 fewer warnings than before, of about 100.000 total.

Message 259 overlaps with message 298 "conversion from '%s' to '%s' may
lose accuracy, arg #%d", and in some cases of potentially lossy
conversions, lint now produces none of these messages. In some other
cases, these warnings were reported redundantly. The cases where
message 298 makes sense will be added back later, as needed.
 1.6 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.5 04-Feb-2021  rillig lint: add back "due to prototype" to message 259

That message is only supposed to warn about compatibility to traditional
C, in case the function should ever be compiled without its prototype
being in effect. All other type checks are supposed to be in another
function, as documented, but that type check misses to report a few
error-prone type combinations (long to char, long to int).

30 years after the introduction of prototypes with C90, almost all
existing code uses prototypes. The warning has thus lost most of its
usefulness and can rather be confusing since a conversion from 'char' to
'long' is not problematic with prototypes in action, and the probability
of the code being backported to a pre-C90 compiler is diminishingly
small.

The words "due to prototype" now serve as a hint again. The proper fix
could be to suppress this warning in C99 mode since that's far enough
from traditional C.
 1.4 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.3 31-Jan-2021  rillig lint: reword message 259 about function argument conversion

The words "due to prototype" are an anachronism from the 1990s.
Nowadays every function is defined using a prototype, which makes these
words redundant.
 1.2 31-Jan-2021  rillig lint: make warning about function argument conversion more detailed

For every conversion it is useful to know both the source and the target
type since these are not always obvious from the code.

The only surprise is the warning in d_gcc_extension. The conversion
there is from 'double' to 'long double', which is a lossless conversion.
This may be a bug in lint.
 1.1 28-Dec-2020  rillig lint: for tests with output, ensure that the output matches
 1.8 08-Jun-2024  rillig tests/lint: group tests by topic
 1.7 09-Jul-2023  rillig lint: remove redundant '#' after 'argument' in diagnostics
 1.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 15-Apr-2022  rillig lint: in C99 mode, do not warn about non-prototype conversions

Message 259 is "argument #%d is converted from '%s' to '%s' due to
prototype", and it is intended to warn about compatibility between
traditional C where functions had no prototypes and standard C where
functions have prototypes.

Running lint in C99 mode is further away from traditional C than running
lint in C90 mode, so that warning doesn't make sense for C99. There are
still some inconsistencies in the 5 language version modes that lint
offers:

-t for traditional C
(no option) for migrating traditional C to C90
-s for C90 code
-S for C99 code
-Ac11 for C11 code

By disabling warning 259 in C99 mode, a typical NetBSD build produces
14.500 fewer warnings than before, of about 100.000 total.

Message 259 overlaps with message 298 "conversion from '%s' to '%s' may
lose accuracy, arg #%d", and in some cases of potentially lossy
conversions, lint now produces none of these messages. In some other
cases, these warnings were reported redundantly. The cases where
message 298 makes sense will be added back later, as needed.
 1.4 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.3 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.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_type_conv2.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.8 17-Jun-2022  rillig 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'.
 1.7 15-Apr-2022  rillig lint: in C99 mode, do not warn about non-prototype conversions

Message 259 is "argument #%d is converted from '%s' to '%s' due to
prototype", and it is intended to warn about compatibility between
traditional C where functions had no prototypes and standard C where
functions have prototypes.

Running lint in C99 mode is further away from traditional C than running
lint in C90 mode, so that warning doesn't make sense for C99. There are
still some inconsistencies in the 5 language version modes that lint
offers:

-t for traditional C
(no option) for migrating traditional C to C90
-s for C90 code
-S for C99 code
-Ac11 for C11 code

By disabling warning 259 in C99 mode, a typical NetBSD build produces
14.500 fewer warnings than before, of about 100.000 total.

Message 259 overlaps with message 298 "conversion from '%s' to '%s' may
lose accuracy, arg #%d", and in some cases of potentially lossy
conversions, lint now produces none of these messages. In some other
cases, these warnings were reported redundantly. The cases where
message 298 makes sense will be added back later, as needed.
 1.6 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.5 04-Feb-2021  rillig lint: add back "due to prototype" to message 259

That message is only supposed to warn about compatibility to traditional
C, in case the function should ever be compiled without its prototype
being in effect. All other type checks are supposed to be in another
function, as documented, but that type check misses to report a few
error-prone type combinations (long to char, long to int).

30 years after the introduction of prototypes with C90, almost all
existing code uses prototypes. The warning has thus lost most of its
usefulness and can rather be confusing since a conversion from 'char' to
'long' is not problematic with prototypes in action, and the probability
of the code being backported to a pre-C90 compiler is diminishingly
small.

The words "due to prototype" now serve as a hint again. The proper fix
could be to suppress this warning in C99 mode since that's far enough
from traditional C.
 1.4 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.3 31-Jan-2021  rillig lint: reword message 259 about function argument conversion

The words "due to prototype" are an anachronism from the 1990s.
Nowadays every function is defined using a prototype, which makes these
words redundant.
 1.2 31-Jan-2021  rillig lint: make warning about function argument conversion more detailed

For every conversion it is useful to know both the source and the target
type since these are not always obvious from the code.

The only surprise is the warning in d_gcc_extension. The conversion
there is from 'double' to 'long double', which is a lossless conversion.
This may be a bug in lint.
 1.1 28-Dec-2020  rillig lint: for tests with output, ensure that the output matches
 1.9 08-Jun-2024  rillig tests/lint: group tests by topic
 1.8 09-Jul-2023  rillig lint: remove redundant '#' after 'argument' in diagnostics
 1.7 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.6 15-Apr-2022  rillig lint: in C99 mode, do not warn about non-prototype conversions

Message 259 is "argument #%d is converted from '%s' to '%s' due to
prototype", and it is intended to warn about compatibility between
traditional C where functions had no prototypes and standard C where
functions have prototypes.

Running lint in C99 mode is further away from traditional C than running
lint in C90 mode, so that warning doesn't make sense for C99. There are
still some inconsistencies in the 5 language version modes that lint
offers:

-t for traditional C
(no option) for migrating traditional C to C90
-s for C90 code
-S for C99 code
-Ac11 for C11 code

By disabling warning 259 in C99 mode, a typical NetBSD build produces
14.500 fewer warnings than before, of about 100.000 total.

Message 259 overlaps with message 298 "conversion from '%s' to '%s' may
lose accuracy, arg #%d", and in some cases of potentially lossy
conversions, lint now produces none of these messages. In some other
cases, these warnings were reported redundantly. The cases where
message 298 makes sense will be added back later, as needed.
 1.5 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.4 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.3 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.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_type_conv3.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.8 17-Jun-2022  rillig 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'.
 1.7 15-Apr-2022  rillig lint: in C99 mode, do not warn about non-prototype conversions

Message 259 is "argument #%d is converted from '%s' to '%s' due to
prototype", and it is intended to warn about compatibility between
traditional C where functions had no prototypes and standard C where
functions have prototypes.

Running lint in C99 mode is further away from traditional C than running
lint in C90 mode, so that warning doesn't make sense for C99. There are
still some inconsistencies in the 5 language version modes that lint
offers:

-t for traditional C
(no option) for migrating traditional C to C90
-s for C90 code
-S for C99 code
-Ac11 for C11 code

By disabling warning 259 in C99 mode, a typical NetBSD build produces
14.500 fewer warnings than before, of about 100.000 total.

Message 259 overlaps with message 298 "conversion from '%s' to '%s' may
lose accuracy, arg #%d", and in some cases of potentially lossy
conversions, lint now produces none of these messages. In some other
cases, these warnings were reported redundantly. The cases where
message 298 makes sense will be added back later, as needed.
 1.6 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.5 04-Feb-2021  rillig lint: add back "due to prototype" to message 259

That message is only supposed to warn about compatibility to traditional
C, in case the function should ever be compiled without its prototype
being in effect. All other type checks are supposed to be in another
function, as documented, but that type check misses to report a few
error-prone type combinations (long to char, long to int).

30 years after the introduction of prototypes with C90, almost all
existing code uses prototypes. The warning has thus lost most of its
usefulness and can rather be confusing since a conversion from 'char' to
'long' is not problematic with prototypes in action, and the probability
of the code being backported to a pre-C90 compiler is diminishingly
small.

The words "due to prototype" now serve as a hint again. The proper fix
could be to suppress this warning in C99 mode since that's far enough
from traditional C.
 1.4 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.3 31-Jan-2021  rillig lint: reword message 259 about function argument conversion

The words "due to prototype" are an anachronism from the 1990s.
Nowadays every function is defined using a prototype, which makes these
words redundant.
 1.2 31-Jan-2021  rillig lint: make warning about function argument conversion more detailed

For every conversion it is useful to know both the source and the target
type since these are not always obvious from the code.

The only surprise is the warning in d_gcc_extension. The conversion
there is from 'double' to 'long double', which is a lossless conversion.
This may be a bug in lint.
 1.1 28-Dec-2020  rillig lint: for tests with output, ensure that the output matches
 1.4 04-Jan-2023  rillig tests/lint: merge tests for ':?' with null pointer constant
 1.3 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 29-Jul-2015  christos new test
 1.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.2 16-Jan-2021  rillig lint: normalize whitespace in tests
 1.1 03-Apr-2015  christos add test for typename as a function param
 1.3 08-Jun-2024  rillig tests/lint: reorganize tests

Tests for a single working language construct don't usually need a
separate file, they can be grouped together, like in expr.c or gcc.c.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_typename_as_var.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.4 08-Jun-2024  rillig tests/lint: reorganize tests

Tests for a single working language construct don't usually need a
separate file, they can be grouped together, like in expr.c or gcc.c.
 1.3 31-Jan-2021  rillig lint: format tests in a common style

The lint tests do not focus on the whitespace since that is the most
boring part of code style. Therefore, format the tests to be readable
by following share/misc/style as close as possible.
 1.2 31-Jan-2021  rillig lint: add common header for all tests

For those tests that didn't use GCC-style line markers such as "# 2",
the line numbers of the diagnostics stay the same. This is purely
conincidental. Before, the 3 lines came from lint's built-in
definitions (see 'builtins' in main1.c), and line number counting
continued as if nothing had happened, making the first line of the
actual file line 4. These 3 built-in lines are now replaced with 3
lines of file header.
 1.1 17-Mar-2012  jruoho branches: 1.1.2;
Deprecate tests/util.
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file d_zero_sized_arrays.c was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.36 14-Sep-2025  rillig lint: fix integer overflow in '<<' evaluation

Just in case that -ftrapv will someday cover '<<' as well, in addition
to the classic arithmetic operators.
 1.35 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.34 05-Mar-2025  rillig tests/lint: demonstrate missing warning about non-prototype
 1.33 30-Nov-2024  rillig tests/lint: add a few more tests to increase code coverage
 1.32 30-Nov-2024  rillig lint: add back optimization for non-query mode

The main point of the optimization is to skip the expensive calls to
type_name when preparing the message details. This was not spelled out
explicitly in the comment.

While here, fix the stray 'previous declaration' message that occurred
whenever a function was first declared as 'static' and later defined
without 'static', see query 16.
 1.31 08-Jun-2024  rillig branches: 1.31.2;
tests/lint: reorganize tests

Tests for a single working language construct don't usually need a
separate file, they can be grouped together, like in expr.c or gcc.c.
 1.30 01-May-2024  rillig lint: make 'offsetof(t, array-member)' a constant expression

The macro 'offsetof(t, m)' already expanded to a constant expression for
scalar members but not for arrays. This was because the macro expanded
to '(size_t)(((t *)0)->m)', which lint internally represents as
'addr(indir(ptr(0) + offset(m)))', and build_address simplifies
'addr(indir(x))' to 'x' if the types match. The types only match for
scalar types though, but not for arrays.

When build_address happens, the type information is incomplete,
therefore 'offsetof(t, array)' has to be simplified at a later point.
 1.29 01-May-2024  rillig tests/lint: test large enum constants and offsetof with array members
 1.28 28-Jan-2024  rillig tests/lint: sort multiple diagnostics per line chronologically

For now, the chronologic order is not enforced but has to be established
manually, for example by removing all 'expect' comment lines and
regenerating them with 'accept.sh -u'.

While here, clean up a few instances that came up when regenerating the
'expect' comments, such as wrong indentation or needless deviation from
the 'expect+1' form.
 1.27 23-Jan-2024  rillig lint: rename symt_t to symbol_kind

It was confusing to have two kinds of "symbol type" (s_type and s_symt),
so rename all related identifiers to be more distinctive.

No functional change.
 1.26 01-Aug-2023  rillig tests/lint: test packed and in-parameter declarations
 1.25 31-Jul-2023  rillig tests/lint: test symbol lookup in unnamed bit-field member declaration
 1.24 31-Jul-2023  rillig lint: fix assertion failure after unnamed bit-field member

Since 2023-07-15.
 1.23 13-Jul-2023  rillig tests/lint: test duplicate type qualifiers in pointer types
 1.22 07-Jul-2023  rillig lint: only skip 'unused' warnings after errors, not other warnings

Previously, in -w mode, any warning suppressed further 'unused'
warnings, even though there was no need to do that. This can be seen in
the test gcc_attribute_var.c, where only the last unused variable from a
function was marked as unused, the others slipped through.

Fixed by counting the errors and the warnings separately and only
combining them if actually desired.
 1.21 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.20 01-Oct-2022  rillig lint: add hyphen to adjective 'old-style'
 1.19 28-Aug-2022  rillig lint: rename dcs manipulation functions to be clearer

No functional change.
 1.18 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.17 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.16 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.15 24-Apr-2022  rillig lint: error out on declarations with implicit int type
 1.14 24-Apr-2022  rillig lint: error out on missing type in declarations
 1.13 03-Apr-2022  rillig lint: fix crash after syntax error in array declaration
 1.12 25-Jul-2021  rillig tests/lint: cover every code line in the grammar
 1.11 25-Jul-2021  rillig tests/lint: test parsing of type_name
 1.10 23-Jul-2021  rillig tests/lint: test lexer for the GCC extension __thread
 1.9 15-Jul-2021  rillig lint: extract dcs_merge_declaration_specifiers from end_type

No functional change.
 1.8 15-Jul-2021  rillig lint: fix internal error for sizeof(typeof)
 1.7 15-Jul-2021  rillig tests/lint: cover abstract_declaration, discover internal error
 1.6 15-Jul-2021  rillig tests/lint: cover more edge cases in the parser
 1.5 14-Jul-2021  rillig tests/lint: add several tests for edge cases in the grammar
 1.4 11-Jul-2021  rillig lint: fix bug when parsing unused variable (since 2021-07-10)

Partially revert to cgram.y 1.248 from 2021-06-29.

This fixes the parse error for variables whose declaration starts with
__attribute__((unused)). In the many refactorings of the last days this
bug has slipped in, and since there were several refactorings in that
area, there may be have been further bugs that are not caught by the
current test suite. Revert for now and maybe apply them later again
when there are more tests.

Things kept from the current version are:

The names of most of the rules, as they correspond more closely to C99
and do not affect the behavior in any way.

In type_direct_decl, the replacement of type_attribute_list with
type_attribute since that nonterminal is already part of a repetition
(saves 4 conflicts).

In block_item, the order of the rules corresponds to C99. This has no
influence on the generated parser, except for the rule numbers, which
are informative.

The merge of the duplicate code for struct_tag, enum_tag and
enum_constant, as they all contained exactly the same code.
 1.3 11-Jul-2021  rillig tests/lint: parse error for unused variable (since 2021-07-10)

Since cgram.y 1.294 from 2021-07-10.
 1.2 10-Jul-2021  rillig tests/lint: test error handling in enum-specifier
 1.1 10-Jul-2021  rillig tests/lint: test declarations
 1.31.2.1 02-Aug-2025  perseant Sync with HEAD
 1.13 17-Jun-2022  rillig 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'.
 1.12 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.11 24-Apr-2022  rillig lint: error out on declarations with implicit int type
 1.10 24-Apr-2022  rillig lint: error out on missing type in declarations
 1.9 03-Apr-2022  rillig lint: fix crash after syntax error in array declaration
 1.8 25-Jul-2021  rillig tests/lint: cover every code line in the grammar
 1.7 25-Jul-2021  rillig tests/lint: test parsing of type_name
 1.6 23-Jul-2021  rillig tests/lint: test lexer for the GCC extension __thread
 1.5 14-Jul-2021  rillig tests/lint: add several tests for edge cases in the grammar
 1.4 11-Jul-2021  rillig lint: fix bug when parsing unused variable (since 2021-07-10)

Partially revert to cgram.y 1.248 from 2021-06-29.

This fixes the parse error for variables whose declaration starts with
__attribute__((unused)). In the many refactorings of the last days this
bug has slipped in, and since there were several refactorings in that
area, there may be have been further bugs that are not caught by the
current test suite. Revert for now and maybe apply them later again
when there are more tests.

Things kept from the current version are:

The names of most of the rules, as they correspond more closely to C99
and do not affect the behavior in any way.

In type_direct_decl, the replacement of type_attribute_list with
type_attribute since that nonterminal is already part of a repetition
(saves 4 conflicts).

In block_item, the order of the rules corresponds to C99. This has no
influence on the generated parser, except for the rule numbers, which
are informative.

The merge of the duplicate code for struct_tag, enum_tag and
enum_constant, as they all contained exactly the same code.
 1.3 11-Jul-2021  rillig tests/lint: parse error for unused variable (since 2021-07-10)

Since cgram.y 1.294 from 2021-07-10.
 1.2 10-Jul-2021  rillig tests/lint: test error handling in enum-specifier
 1.1 10-Jul-2021  rillig tests/lint: test declarations
 1.17 03-Jan-2025  rillig lint: add detail to message about obsolete identifier list
 1.16 01-Dec-2024  rillig lint: warn about function definitions that still use identifier lists
 1.15 28-Sep-2024  rillig lint: handle __attribute__((__unused__)) for functions and variables

Previously, lint ignored the '__unused' marker, requiring its own /*
ARGSUSED */ marker instead.

Previously, attributes were interpreted as soon as the closing
parenthesis was parsed. For a function definition such as '__unused
static void f(void) {}', this was too early, as the attribute was not
connected to the function, as the function was not parsed yet.

Now, the 'unused' attribute is passed around by the parser, until it is
merged into the declarator where it belongs. Due to an inaccuracy in
the grammar, the 'used' attribute has to be passed through a
parameter_list, even though a parameter list is not related to
attributes. Still, it's better than before.
 1.14 28-Sep-2024  rillig lint: allow more than one __attribute__ on a parameter declaration
 1.13 28-Jan-2024  rillig branches: 1.13.2;
tests/lint: sort multiple diagnostics per line chronologically

For now, the chronologic order is not enforced but has to be established
manually, for example by removing all 'expect' comment lines and
regenerating them with 'accept.sh -u'.

While here, clean up a few instances that came up when regenerating the
'expect' comments, such as wrong indentation or needless deviation from
the 'expect+1' form.
 1.12 02-Aug-2023  rillig lint: distinguish between arguments and parameters
 1.11 02-Aug-2023  rillig lint: simplify handling of old-style arguments
 1.10 09-Jul-2023  rillig lint: clean up wording in diagnostics

Use the term 'parameter' as defined in C99 3.15.
 1.9 09-Jul-2023  rillig lint: clean up the wording of a few diagnostics
 1.8 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.7 20-Jun-2022  rillig lint: add quotes around several placeholders in messages
 1.6 25-Jul-2021  rillig tests/lint: demonstrate internal error in parsing a declaration
 1.5 10-Jul-2021  rillig tests/lint: add more tests for covering the grammar
 1.4 10-Jul-2021  rillig tests/lint: add code coverage for grammar rule parameter_declaration
 1.3 10-Jul-2021  rillig lint: add code coverage for grammar rule direct_notype_param_decl
 1.2 10-Jul-2021  rillig tests/lint: move test for __attribute__ out of msg_124.c

That test case didn't belong there since there was no chance of getting
an 'illegal pointer combination' by applying an operator.
 1.1 09-Jul-2021  rillig tests/lint: add test for unrealistic edge cases in declarations

The example code for triggering these grammar rules looks completely
contrived. Even if lint had not implemented these cases, hopefully
nobody would have ever noticed.
 1.13.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 25-Jul-2021  rillig tests/lint: demonstrate internal error in parsing a declaration
 1.2 10-Jul-2021  rillig tests/lint: add code coverage for grammar rule parameter_declaration
 1.1 09-Jul-2021  rillig tests/lint: add test for unrealistic edge cases in declarations

The example code for triggering these grammar rules looks completely
contrived. Even if lint had not implemented these cases, hopefully
nobody would have ever noticed.
 1.12 28-Jan-2024  rillig tests/lint: sort multiple diagnostics per line chronologically

For now, the chronologic order is not enforced but has to be established
manually, for example by removing all 'expect' comment lines and
regenerating them with 'accept.sh -u'.

While here, clean up a few instances that came up when regenerating the
'expect' comments, such as wrong indentation or needless deviation from
the 'expect+1' form.
 1.11 22-Oct-2023  rillig tests/lint: test GCC attributes after abstract function type
 1.10 02-Aug-2023  rillig lint: fix handling of unnamed function parameters
 1.9 01-Jul-2023  rillig tests/lint: rework tests for type names
 1.8 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.7 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.6 01-Apr-2022  rillig lint: add type details to message about 'sizeof(function)'

The code in add_function is severely broken, it mixes up the return type
of the function with the argument types. For now, at least show the
guessed type in the diagnostic, to allow human readers quickly spot the
bug.

Extend the test cases in decl_direct_abstract.c to show that the
behavior differs unreasonably if the first parameter of the function is
equal to its return type.
 1.5 01-Apr-2022  rillig lint: improve determination of abstract typename

Still not perfect, but at least a step in the right direction. See
decl_direct_abstract.c for the missing edge cases.

See PR#22119.
 1.4 14-Sep-2021  rillig tests/lint: fix typo from previous commit
 1.3 14-Sep-2021  rillig lint: support int[*][3] from C99

No warning in pre-C99 mode since this declarator is not used in practice
anyway.
 1.2 14-Sep-2021  rillig tests/lint: test missing support for int[*][3]
 1.1 13-Sep-2021  rillig tests/lint: add more tests for direct-abstract-declarator

Lint's grammar in this area differs a lot from the grammar in C99. GCC's
parser has a long comment about special cases in this area. It's tricky
to even parse these type names correctly, let alone assign them the
correct types, that's why it needs more tests before trying to refactor
that code.
 1.6 17-Jun-2022  rillig 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'.
 1.5 01-Apr-2022  rillig lint: add type details to message about 'sizeof(function)'

The code in add_function is severely broken, it mixes up the return type
of the function with the argument types. For now, at least show the
guessed type in the diagnostic, to allow human readers quickly spot the
bug.

Extend the test cases in decl_direct_abstract.c to show that the
behavior differs unreasonably if the first parameter of the function is
equal to its return type.
 1.4 01-Apr-2022  rillig lint: improve determination of abstract typename

Still not perfect, but at least a step in the right direction. See
decl_direct_abstract.c for the missing edge cases.

See PR#22119.
 1.3 14-Sep-2021  rillig lint: support int[*][3] from C99

No warning in pre-C99 mode since this declarator is not used in practice
anyway.
 1.2 14-Sep-2021  rillig tests/lint: test missing support for int[*][3]
 1.1 13-Sep-2021  rillig tests/lint: add more tests for direct-abstract-declarator

Lint's grammar in this area differs a lot from the grammar in C99. GCC's
parser has a long comment about special cases in this area. It's tricky
to even parse these type names correctly, let alone assign them the
correct types, that's why it needs more tests before trying to refactor
that code.
 1.6 29-Oct-2024  rillig lint: add details to message about too large integer constant
 1.5 01-May-2024  rillig branches: 1.5.2;
tests/lint: test large enum constants and offsetof with array members
 1.4 30-Jun-2023  rillig lint: clean up names related to declaration levels

The previous prefix 'DK_' (declaration level kind) had a conflict with
the 'DK_' (designator kind) in init.c, so change the prefix to 'DLK_'.
The new name for dinfo_t is decl_level, which is more expressive.

No functional change.
 1.3 16-Apr-2022  rillig lint: in C99 mode, allow trailing comma in enum declarations

Adjust the test to be run in C90 mode instead of traditional mode, since
traditional C didn't have enums.
 1.2 08-Apr-2022  rillig lint: remove unused message 70, add some more tests
 1.1 15-Jul-2021  rillig tests/lint: cover more edge cases in the parser
 1.5.2.1 02-Aug-2025  perseant Sync with HEAD
 1.3 17-Jun-2022  rillig 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'.
 1.2 08-Apr-2022  rillig lint: remove unused message 70, add some more tests
 1.1 15-Jul-2021  rillig tests/lint: cover more edge cases in the parser
 1.3 11-Jul-2023  rillig lint: update wording in diagnostic for C99
 1.2 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.1 15-Jul-2021  rillig tests/lint: cover more edge cases in the parser
 1.2 17-Jun-2022  rillig 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'.
 1.1 15-Jul-2021  rillig tests/lint: cover more edge cases in the parser
 1.4 27-Feb-2022  rillig lint: C99 has been released, so refer to it by its proper name
 1.3 15-Jul-2021  rillig tests/lint: cover more edge cases in the parser
 1.2 15-Jul-2021  rillig lint: remove message 66 about missing semicolon in struct-declaration
 1.1 15-Jul-2021  rillig tests/lint: test struct declarations
 1.5 17-Jun-2022  rillig 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'.
 1.4 27-Feb-2022  rillig lint: C99 has been released, so refer to it by its proper name
 1.3 15-Jul-2021  rillig tests/lint: cover more edge cases in the parser
 1.2 15-Jul-2021  rillig lint: remove message 66 about missing semicolon in struct-declaration
 1.1 15-Jul-2021  rillig tests/lint: test struct declarations
 1.20 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.19 03-Jan-2025  rillig lint: add detail to message about obsolete identifier list
 1.18 01-Dec-2024  rillig lint: warn about function definitions that still use identifier lists
 1.17 22-May-2023  rillig branches: 1.17.2;
lint: rename constant NOTSPEC to NO_TSPEC

It was too easy to misread the old name as NOT_SPEC instead of the
intended NO_TSPEC.
 1.16 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.15 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.14 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.13 22-Dec-2021  rillig lint: remove spaces around bit-field colon

As seen in /usr/share/misc/style.

No binary change.
 1.12 05-Sep-2021  rillig tests/lint: document the fixed assertion failure for struct

The change to cgram.y 1.328 from 2021-07-15 didn't fix the crash on
purpose, it was merely a side effect. The grammar rule that probably
fixed this was that the error handling now skips to the next T_SEMI,
which it didn't do before.
 1.11 25-Aug-2021  rillig tests/lint: test conversion from long long to intptr_t on ilp32

Seen in usr.bin/make/var.c:1608.
 1.10 21-Jul-2021  rillig lint: rename grammar rules for specifier-qualifier-list

No functional change.
 1.9 15-Jul-2021  rillig tests/lint: cover more edge cases in the parser
 1.8 15-Jul-2021  rillig lint: remove message 66 about missing semicolon in struct-declaration
 1.7 15-Jul-2021  rillig tests/lint: test struct declarations
 1.6 14-Jul-2021  rillig tests/lint: add several tests for edge cases in the grammar
 1.5 10-Jul-2021  rillig lint: fix parsing of __attribute__ for member (since 2021-07-10)

Since cgram.y 1.280 from 2021-07-10, lint could not parse struct members
that have multiple __attribute__ in front of their type.
 1.4 10-Jul-2021  rillig tests/lint: demonstrate parse error for __attribute__ member
 1.3 10-Jul-2021  rillig lint: rename clrtyp/deftyp to begin_type/end_type

The abbreviations clr/def did not make it obvious that these two
functions or grammar rules form pairs.

No functional change.
 1.2 20-Jun-2021  rillig lint: fix assertion failure on malformed struct declaration

Found using afl.
 1.1 19-Jun-2021  rillig lint: fix assertion failure in struct with unnamed member

Found using afl.
 1.17.2.1 02-Aug-2025  perseant Sync with HEAD
 1.12 17-Jun-2022  rillig 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'.
 1.11 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.10 05-Sep-2021  rillig tests/lint: document the fixed assertion failure for struct

The change to cgram.y 1.328 from 2021-07-15 didn't fix the crash on
purpose, it was merely a side effect. The grammar rule that probably
fixed this was that the error handling now skips to the next T_SEMI,
which it didn't do before.
 1.9 25-Aug-2021  rillig tests/lint: test conversion from long long to intptr_t on ilp32

Seen in usr.bin/make/var.c:1608.
 1.8 15-Jul-2021  rillig tests/lint: cover more edge cases in the parser
 1.7 15-Jul-2021  rillig lint: remove message 66 about missing semicolon in struct-declaration
 1.6 15-Jul-2021  rillig tests/lint: test struct declarations
 1.5 14-Jul-2021  rillig tests/lint: add several tests for edge cases in the grammar
 1.4 10-Jul-2021  rillig lint: fix parsing of __attribute__ for member (since 2021-07-10)

Since cgram.y 1.280 from 2021-07-10, lint could not parse struct members
that have multiple __attribute__ in front of their type.
 1.3 10-Jul-2021  rillig tests/lint: demonstrate parse error for __attribute__ member
 1.2 20-Jun-2021  rillig lint: fix assertion failure on malformed struct declaration

Found using afl.
 1.1 19-Jun-2021  rillig lint: fix assertion failure in struct with unnamed member

Found using afl.
 1.18 09-Jun-2024  rillig tests/lint: demonstrate wrong result for nested function calls
 1.17 22-May-2023  rillig lint: fix emitted type for arrays of unknown size
 1.16 22-May-2023  rillig tests/lint: demonstrate wrong emitted array length in initialization

Seen in usr.bin/indent/debug.c, in the various 'name' arrays.
 1.15 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.14 01-Oct-2022  rillig lint: add hyphen to adjective 'old-style'
 1.13 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.12 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.11 24-Apr-2022  rillig lint: error out on missing type in declarations
 1.10 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.9 28-Nov-2021  rillig tests/lint: update history of exporting unnamed objects
 1.8 28-Nov-2021  rillig tests/lint1: reproduce parse error for accidentally exported name

Seen in usr.sbin/cpuctl/aarch64.c line 118.

error: aarch64.ln:857:
not alnum or _: (for '118d-1.0d1200000000_tmpA16PcC')

The name 00000000_tmp was not supposed to be exported.
 1.7 10-Sep-2021  rillig lint: replace space followed by tab with simply tab

No functional change.
 1.6 04-Sep-2021  rillig tests/lint: test emitting format strings
 1.5 30-Aug-2021  rillig tests/lint: test writing and reading .ln files

The test case for reading varargs functions is no longer necessary, the
code is covered by the newly added tests as well.

Test inline function and return value usage.
 1.4 30-Aug-2021  rillig tests/lint: test varargs, printflike, scanflike
 1.3 28-Aug-2021  rillig tests/lint: demonstrate that GCC builtins are emitted by default

They will be skipped in a follow-up commit, but to see the effects of
that, they first need to be emitted.
 1.2 08-Aug-2021  rillig tests/lint: test passing of printf-like strings between lint1 and lint2
 1.1 18-Apr-2021  rillig lint: test emitting of symbol information in the .ln files

Even though the new test is quite large, it didn't find any bugs in the
code. The only thing I'm unsure about is why static functions are
exported as well, since they are supposed to be local to the translation
unit.
 1.5 17-Jun-2022  rillig 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'.
 1.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 24-Apr-2022  rillig lint: error out on missing type in declarations
 1.2 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.1 18-Apr-2021  rillig lint: test emitting of symbol information in the .ln files

Even though the new test is quite large, it didn't find any bugs in the
code. The only thing I'm unsure about is why static functions are
exported as well, since they are supposed to be local to the translation
unit.
 1.15 09-Jun-2024  rillig lint: fix usage marker for nested function calls
 1.14 09-Jun-2024  rillig tests/lint: demonstrate wrong result for nested function calls
 1.13 22-May-2023  rillig tests/lint1: allow whitespace in files containing the expected output

This reduces the amount of wizardry needed to interpret the files. For
a more gentle introduction of the file format, see ../lint2/msg_000.ln.

The whitespace that is removed is very similar to the one in the lint2
tests, the difference is that '%<space>' and '%#' need to be preserved
in abbreviated printf and scanf format strings.
 1.12 22-May-2023  rillig lint: fix emitted type for arrays of unknown size
 1.11 22-May-2023  rillig tests/lint: demonstrate wrong emitted array length in initialization

Seen in usr.bin/indent/debug.c, in the various 'name' arrays.
 1.10 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.9 28-Nov-2021  rillig lint: do not export unnamed objects to the .ln file

Since these objects are unnamed, they cannot be referenced by other
files or even create name clashes.

Seen in usr.sbin/cpuctl/aarch64.c, reported by Christos.
 1.8 28-Nov-2021  rillig tests/lint1: reproduce parse error for accidentally exported name

Seen in usr.sbin/cpuctl/aarch64.c line 118.

error: aarch64.ln:857:
not alnum or _: (for '118d-1.0d1200000000_tmpA16PcC')

The name 00000000_tmp was not supposed to be exported.
 1.7 04-Sep-2021  rillig tests/lint: test emitting format strings
 1.6 30-Aug-2021  rillig tests/lint: test writing and reading .ln files

The test case for reading varargs functions is no longer necessary, the
code is covered by the newly added tests as well.

Test inline function and return value usage.
 1.5 30-Aug-2021  rillig tests/lint: test varargs, printflike, scanflike
 1.4 28-Aug-2021  rillig lint: do not emit GCC builtin functions

Lint1 no longer emits declarations of GCC builtin functions and calls to
them.

Previously, lint generated 3421 useless warnings in a default NetBSD
build, like this:

__atomic_load_n, arg 1 used inconsistently
acl.c(216)[pointer to unsigned int]
rbtdb.c(921)[pointer to unsigned short]

This was because lint just doesn't understand that these functions are
type-generic, which is indeed unusual in C.

These useless warnings made the lint output more frightening than it
should actually be. Together with the strange formatting of the
diagnostics (space-space-tab after the main message, two spaces and two
colons between the occurrences, symbols are listed in hashcode order),
this creates the impression that lint is not intended to be a
user-friendly tool.

For now, fix the excess warnings, leaving the other items for later.
 1.3 28-Aug-2021  rillig tests/lint: demonstrate that GCC builtins are emitted by default

They will be skipped in a follow-up commit, but to see the effects of
that, they first need to be emitted.
 1.2 08-Aug-2021  rillig tests/lint: test passing of printf-like strings between lint1 and lint2
 1.1 27-Jun-2021  rillig tests/lint: rename expected .ln file to .exp-ln

This way, the hack for suffixes is no longer needed.
 1.4 27-Jun-2021  rillig tests/lint: rename expected .ln file to .exp-ln

This way, the hack for suffixes is no longer needed.
 1.3 21-Apr-2021  christos Put things back, emit.ln it was meant to be there.
 1.2 21-Apr-2021  christos remove emit.ln; looks like an accident and breaks the build.
 1.1 18-Apr-2021  rillig lint: test emitting of symbol information in the .ln files

Even though the new test is quite large, it didn't find any bugs in the
code. The only thing I'm unsure about is why static functions are
exported as well, since they are supposed to be local to the translation
unit.
 1.2 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.1 05-Aug-2021  rillig tests/lint: test emitting 128-bit integer types for lint2
 1.2 22-May-2023  rillig tests/lint1: allow whitespace in files containing the expected output

This reduces the amount of wizardry needed to interpret the files. For
a more gentle introduction of the file format, see ../lint2/msg_000.ln.

The whitespace that is removed is very similar to the one in the lint2
tests, the difference is that '%<space>' and '%#' need to be preserved
in abbreviated printf and scanf format strings.
 1.1 05-Aug-2021  rillig tests/lint: test emitting 128-bit integer types for lint2
 1.1 08-Jun-2024  rillig tests/lint: reorganize tests

Tests for a single working language construct don't usually need a
separate file, they can be grouped together, like in expr.c or gcc.c.
 1.10 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.9 27-Feb-2025  rillig tests/lint: spell out the type combinations for the '?:' operator
 1.8 14-Jul-2023  rillig branches: 1.8.2;
lint: clean up comments, add a test for the '?:' operator
 1.7 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.6 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.5 01-Aug-2021  rillig tests/lint: re-add the test for __uint128_t
 1.4 01-Aug-2021  rillig tests/lint: fully cover the usual arithmetic conversions
 1.3 01-Aug-2021  rillig lint: fix usual arithmetic conversions for 128-bit integer types
 1.2 01-Aug-2021  rillig lint: demonstrate wrong integer conversion for __uint128_t
 1.1 01-Aug-2021  rillig tests/lint: test the usual arithmetic conversions

The function 'balance' does not mention __uint128_t and nevertheless
works as expected. Need to investigate further.
 1.8.2.1 02-Aug-2025  perseant Sync with HEAD
 1.6 17-Jun-2022  rillig 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'.
 1.5 01-Aug-2021  rillig tests/lint: re-add the test for __uint128_t
 1.4 01-Aug-2021  rillig tests/lint: fully cover the usual arithmetic conversions
 1.3 01-Aug-2021  rillig lint: fix usual arithmetic conversions for 128-bit integer types
 1.2 01-Aug-2021  rillig lint: demonstrate wrong integer conversion for __uint128_t
 1.1 01-Aug-2021  rillig tests/lint: test the usual arithmetic conversions

The function 'balance' does not mention __uint128_t and nevertheless
works as expected. Need to investigate further.
 1.3 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.2 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.1 01-Aug-2021  rillig tests/lint: test the usual arithmetic conversions in traditional C
 1.2 17-Jun-2022  rillig 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'.
 1.1 01-Aug-2021  rillig tests/lint: test the usual arithmetic conversions in traditional C
 1.7 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.6 08-Jun-2024  rillig branches: 1.6.2;
tests/lint: group tests by topic
 1.5 06-Aug-2023  rillig lint: since C99, a non-void function must return a value
 1.4 07-Jul-2023  rillig 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.3 03-Aug-2021  rillig lint: add quotes around placeholder in message 214

function '%s' expects to return value
 1.2 03-Aug-2021  rillig lint: casting to a struct is not allowed in C99, only with GCC
 1.1 03-Aug-2021  rillig tests/lint: test casting a struct to another struct
 1.6.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 03-Aug-2021  rillig lint: add quotes around placeholder in message 214

function '%s' expects to return value
 1.2 03-Aug-2021  rillig lint: casting to a struct is not allowed in C99, only with GCC
 1.1 03-Aug-2021  rillig tests/lint: test casting a struct to another struct
 1.17 10-Apr-2025  rillig lint: remove now-unnecessary CONSTCOND comments
 1.16 08-Jun-2024  rillig branches: 1.16.2;
lint: add details to warnings about negative constant to unsigned
 1.15 10-Mar-2024  rillig lint: add details to the message about integer overflow

Having only the operator was too unspecific to be actionable, so add the
actual numbers and the data type.
 1.14 10-Mar-2024  rillig lint: detect more cases of integer overflow in constant expressions

For unsigned integers, detect when 'a + b' wraps around.
 1.13 10-Mar-2024  rillig lint: remove wrong warning about overflow in unary '-' for unsigned
 1.12 09-Mar-2024  rillig lint: fix excessive overflow warning after division by zero
 1.11 06-Jan-2024  rillig lint: remove redundant parentheses, braces and comments

Rename the functions for folding constant expressions, to make the
comments redundant.
 1.10 09-Jul-2023  rillig lint: clean up the wording of a few diagnostics
 1.9 02-Jul-2023  rillig lint: rename 'quad' to 'signed int' or 'unsigned int'

No functional change.
 1.8 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.7 19-Apr-2022  rillig lint: fix integer overflow on seeing -(uint64_t)INT64_MIN

Seen in external/cddl/osnet/dist/lib/libuutil/common/uu_strtoint.c,
which is protected by a NOLINT in ../Makefile.inc.
 1.6 15-Apr-2022  rillig lint: in C99 mode, do not warn about non-prototype conversions

Message 259 is "argument #%d is converted from '%s' to '%s' due to
prototype", and it is intended to warn about compatibility between
traditional C where functions had no prototypes and standard C where
functions have prototypes.

Running lint in C99 mode is further away from traditional C than running
lint in C90 mode, so that warning doesn't make sense for C99. There are
still some inconsistencies in the 5 language version modes that lint
offers:

-t for traditional C
(no option) for migrating traditional C to C90
-s for C90 code
-S for C99 code
-Ac11 for C11 code

By disabling warning 259 in C99 mode, a typical NetBSD build produces
14.500 fewer warnings than before, of about 100.000 total.

Message 259 overlaps with message 298 "conversion from '%s' to '%s' may
lose accuracy, arg #%d", and in some cases of potentially lossy
conversions, lint now produces none of these messages. In some other
cases, these warnings were reported redundantly. The cases where
message 298 makes sense will be added back later, as needed.
 1.5 23-Aug-2021  rillig lint: add quotes around placeholder in message 141
 1.4 22-Aug-2021  rillig lint: fix folding of comparisons in constant expressions
 1.3 22-Aug-2021  rillig tests/lint: demonstrate wrong folding of 64-bit numbers
 1.2 19-Aug-2021  rillig lint: fix wrong integer overflow warning for unsigned types
 1.1 19-Aug-2021  rillig tests/lint: test folding of constant expressions

Since November 2001, there is a comment above the function 'fold' that
suggests there are a few bugs concerning overflow detection. Add some
first 'proper regression tests' to prove these bugs.
 1.16.2.1 02-Aug-2025  perseant Sync with HEAD
 1.8 17-Jun-2022  rillig 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'.
 1.7 19-Apr-2022  rillig lint: fix integer overflow on seeing -(uint64_t)INT64_MIN

Seen in external/cddl/osnet/dist/lib/libuutil/common/uu_strtoint.c,
which is protected by a NOLINT in ../Makefile.inc.
 1.6 15-Apr-2022  rillig lint: in C99 mode, do not warn about non-prototype conversions

Message 259 is "argument #%d is converted from '%s' to '%s' due to
prototype", and it is intended to warn about compatibility between
traditional C where functions had no prototypes and standard C where
functions have prototypes.

Running lint in C99 mode is further away from traditional C than running
lint in C90 mode, so that warning doesn't make sense for C99. There are
still some inconsistencies in the 5 language version modes that lint
offers:

-t for traditional C
(no option) for migrating traditional C to C90
-s for C90 code
-S for C99 code
-Ac11 for C11 code

By disabling warning 259 in C99 mode, a typical NetBSD build produces
14.500 fewer warnings than before, of about 100.000 total.

Message 259 overlaps with message 298 "conversion from '%s' to '%s' may
lose accuracy, arg #%d", and in some cases of potentially lossy
conversions, lint now produces none of these messages. In some other
cases, these warnings were reported redundantly. The cases where
message 298 makes sense will be added back later, as needed.
 1.5 23-Aug-2021  rillig lint: add quotes around placeholder in message 141
 1.4 22-Aug-2021  rillig lint: fix folding of comparisons in constant expressions
 1.3 22-Aug-2021  rillig tests/lint: demonstrate wrong folding of 64-bit numbers
 1.2 19-Aug-2021  rillig lint: fix wrong integer overflow warning for unsigned types
 1.1 19-Aug-2021  rillig tests/lint: test folding of constant expressions

Since November 2001, there is a comment above the function 'fold' that
suggests there are a few bugs concerning overflow detection. Add some
first 'proper regression tests' to prove these bugs.
 1.4 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.3 08-Jun-2024  rillig branches: 1.3.2;
tests/lint: reorganize tests

Tests for a single working language construct don't usually need a
separate file, they can be grouped together, like in expr.c or gcc.c.
 1.2 22-Aug-2021  rillig lint: fix folding of comparisons in constant expressions
 1.1 22-Aug-2021  rillig tests/lint: demonstrate wrong constant folding in strict bool mode

Found while investigating wrong constant folding in default mode.
 1.3.2.1 02-Aug-2025  perseant Sync with HEAD
 1.3 17-Jun-2022  rillig 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'.
 1.2 22-Aug-2021  rillig lint: fix folding of comparisons in constant expressions
 1.1 22-Aug-2021  rillig tests/lint: demonstrate wrong constant folding in strict bool mode

Found while investigating wrong constant folding in default mode.
 1.12 01-May-2024  rillig lint: support _Alignas and __attribute__((__aligned(4)))
 1.11 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.10 25-Aug-2022  rillig lint: remove explicit list of known GCC attributes

Most GCC attributes consist of a single identifier. Up to now, it was
necessary to list each of these identifiers in the grammar, even those
that only apply to a single target architecture.

Instead, parse the general form of attributes, matching the few
attributes that lint handles by name instead. While here, rename the
grammar rules to use the GCC terms.

To avoid conflicts between the global function 'printf' and the GCC
attribute of the same name, do not add GCC attributes to the symbol
table, and don't make these symbols 'extern' either.

ok christos@.
 1.9 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.8 16-Nov-2021  rillig lint: rename attron to in_gcc_attribute

No functional change.
 1.7 26-Jul-2021  rillig lint: fix parse error in conditional expression (since 2021-07-15)
 1.6 26-Jul-2021  rillig tests/lint: show bug in conditional expression (since 2021-07-15)

Since cgram.y 1.325 from 2021-07-15, conditional expressions did not
accept a comma-expression in the then-branch anymore. In practice, this
is an edge case though since comma expressions are rare.
 1.5 26-Jul-2021  rillig lint: fix parsing of chained assignments (since 2021-07-15)

The grammar rule for assignment_expression is quite different from those
of the other expressions, for 2 reasons: first, its precedence is
right-to-left. Second, its left-hand side must be an lvalue, which
rules out all binary operators. K&R C even had a grammar rule named
'lvalue' for this purpose. Later C standards made the kinds of
expressions more fine-grained and used 'unary_expression' in this place.
 1.4 26-Jul-2021  rillig tests/lint: demonstrate bug in chained assignment (since 2021-07-15)

Since cgram.y 1.325 from 2021-07-15, lint has been parsing assignment
expressions correctly. It got the associativity wrong.
 1.3 15-Jul-2021  rillig tests/lint: explain global variables in __attribute__
 1.2 15-Jul-2021  rillig lint: in the grammar, replace %prec with explicit rules

This way, in the arguments of __attribute__, where only constant
expressions are expected, a '=' leads to a syntax error. Previously,
this was not detected.

No noticeable change in practice since these cases are already handled
by the compilers.
 1.1 15-Jul-2021  rillig tests/lint: test precedence of operators
 1.8 17-Jun-2022  rillig 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'.
 1.7 26-Jul-2021  rillig lint: fix parse error in conditional expression (since 2021-07-15)
 1.6 26-Jul-2021  rillig tests/lint: show bug in conditional expression (since 2021-07-15)

Since cgram.y 1.325 from 2021-07-15, conditional expressions did not
accept a comma-expression in the then-branch anymore. In practice, this
is an edge case though since comma expressions are rare.
 1.5 26-Jul-2021  rillig lint: fix parsing of chained assignments (since 2021-07-15)

The grammar rule for assignment_expression is quite different from those
of the other expressions, for 2 reasons: first, its precedence is
right-to-left. Second, its left-hand side must be an lvalue, which
rules out all binary operators. K&R C even had a grammar rule named
'lvalue' for this purpose. Later C standards made the kinds of
expressions more fine-grained and used 'unary_expression' in this place.
 1.4 26-Jul-2021  rillig tests/lint: demonstrate bug in chained assignment (since 2021-07-15)

Since cgram.y 1.325 from 2021-07-15, lint has been parsing assignment
expressions correctly. It got the associativity wrong.
 1.3 15-Jul-2021  rillig tests/lint: explain global variables in __attribute__
 1.2 15-Jul-2021  rillig lint: in the grammar, replace %prec with explicit rules

This way, in the arguments of __attribute__, where only constant
expressions are expected, a '=' leads to a syntax error. Previously,
this was not detected.

No noticeable change in practice since these cases are already handled
by the compilers.
 1.1 15-Jul-2021  rillig tests/lint: test precedence of operators
 1.5 05-Nov-2024  rillig lint: fix cross references in comments
 1.4 28-Mar-2023  rillig branches: 1.4.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 04-Jan-2023  rillig tests/lint: document where to find the test results for promotions
 1.2 16-Aug-2021  rillig tests/lint: test default argument promotion with enum
 1.1 16-Aug-2021  rillig tests/lint: test arithmetic promotions and enums
 1.4.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 30-Dec-2023  rillig tests/lint: add spaces to expected files, for better readability
 1.3 04-Jan-2023  rillig tests/lint: document where to find the test results for promotions
 1.2 16-Aug-2021  rillig tests/lint: test default argument promotion with enum
 1.1 16-Aug-2021  rillig tests/lint: test arithmetic promotions and enums
 1.6 12-Apr-2025  rillig lint: reword messages that apply to traditional C
 1.5 05-Nov-2024  rillig lint: fix cross references in comments
 1.4 28-Mar-2023  rillig branches: 1.4.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 04-Jan-2023  rillig tests/lint: document where to find the test results for promotions
 1.2 16-Aug-2021  rillig tests/lint: test default argument promotion with enum
 1.1 16-Aug-2021  rillig tests/lint: test arithmetic promotions and enums
 1.4.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 30-Dec-2023  rillig tests/lint: add spaces to expected files, for better readability
 1.3 04-Jan-2023  rillig tests/lint: document where to find the test results for promotions
 1.2 16-Aug-2021  rillig tests/lint: test default argument promotion with enum
 1.1 16-Aug-2021  rillig tests/lint: test arithmetic promotions and enums
 1.6 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.5 28-Mar-2023  rillig branches: 1.5.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.3 05-Jul-2021  rillig tests/lint: fix typos in comment in expr_range
 1.2 15-May-2021  rillig branches: 1.2.2;
lint: warn about unreachable case labels for '&&'

See octeon_gmxreg.h 1.2 from 2020-06-18 for an example, where
RXN_RX_INBND_SPEED was cleaned up without adjusting the corresponding
code in octeon_gmx.c.
 1.1 14-May-2021  rillig tests/lint: test bitwise mismatch in switch statement
 1.2.2.2 31-May-2021  cjep sync with head
 1.2.2.1 15-May-2021  cjep file expr_range.c was added on branch cjep_staticlib_x on 2021-05-31 22:15:24 +0000
 1.5.2.1 02-Aug-2025  perseant Sync with HEAD
 1.3 17-Jun-2022  rillig 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'.
 1.2 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.1 16-May-2021  rillig branches: 1.1.2;
tests/lint: add expected output for testing '&' in switch statement
 1.1.2.2 31-May-2021  cjep sync with head
 1.1.2.1 16-May-2021  cjep file expr_range.exp was added on branch cjep_staticlib_x on 2021-05-31 22:15:24 +0000
 1.19 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.18 03-May-2024  rillig branches: 1.18.2;
tests/lint: fix supposedly platform-independent type definitions

No idea where I got the previous type definitions from. The typedef
names looked just too convincing to actually check the underlying types.
 1.17 03-May-2024  rillig tests/lint: skip test for sizeof struct on 32-bit platforms

Even though the test only uses fixed-size types, lint's computed size of
the resulting struct differs between i386 (80) and x86_64 (112). Both
are wrong, probably due to the unrelated struct declaration above, as
already mentioned in the comments.
 1.16 02-May-2024  rillig tests/lint: demonstrate wrong struct size calculation
 1.15 13-Mar-2024  rillig tests/lint: ensure that lint correctly decays array parameter types
 1.14 05-Aug-2023  rillig lint: implement __builtin_offsetof for the simplest cases

Cases not covered:
1. C99 allows designators in the offsetof macro.
2. For packed types, the offset is likely to be incorrect.
 1.13 09-Jul-2023  rillig lint: clean up wording in diagnostics

Use the term 'parameter' as defined in C99 3.15.
 1.12 30-Jun-2023  rillig lint: fix handling of unnamed struct/union members

The support for unnamed struct/union members that was added in decl.c
1.60 from 2015-10-13 was simple but wrong. It didn't cover initializers
of these structures and computed wrong sizes for structures containing
anonymous unions. At that time, the handling of initializers was broken
as well, it was fixed 6 years later in init.c 1.229 from 2021-12-22.

Real-life examples for code that lint couldn't handle are:

* external/bsd/jemalloc/dist/src/jemalloc.c
* external/mit/xorg/lib/dri.old/Makefile
 1.11 30-Jun-2023  rillig tests/lint: extend tests for sizeof and alignof
 1.10 30-Jun-2023  rillig lint: fix computation of bit-field width

When bit-fields in packed structs were added on 2009-10-02, lint assumed
that they would only use 'signed int' or 'unsigned int' as storage unit,
even though C99 also allows _Bool.

The cleanup commit for decl.c 1.225 from 2021-08-28 accidentally changed
the rounding mode for bit-field storage units from round-up to
round-down.
 1.9 30-Jun-2023  rillig tests/lint: add more tests for sizeof, offsetof, alignof
 1.8 30-Jun-2023  rillig tests/lint: extend test for sizeof and offsetof
 1.7 30-Jun-2023  rillig tests/lint: demonstrate bugs in anonymous struct/union handling
 1.6 28-Jun-2023  rillig tests/lint: demonstrate wrong size calculation in anonymous union
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 16-Jan-2023  rillig tests/lint: fix typo in comment
 1.3 15-Jan-2023  rillig tests/lint: fix test for sizeof with variable-length array
 1.2 15-Jan-2023  rillig tests/lint: add more tests for sizeof
 1.1 15-Jan-2023  rillig tests/lint: add test for parsing sizeof expressions
 1.18.2.1 02-Aug-2025  perseant Sync with HEAD
 1.3 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.2 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.1 08-Apr-2021  rillig lint: in code from included files, print stack trace

Previously, the standard NetBSD build generated several lint warnings in
lhash.h from OpenSSL, without providing any hint as to which file
actually included that header. In cases like these, lint now interprets
the line number information in the preprocessor output from GCC to
reconstruct the exact include path to the file in question.

The program check-expect.lua had to be rewritten almost completely since
it assumed that all diagnostics would come from the main file. In all
existing tests, this was true, but these tests did not cover all cases
that occurred in practice. Now it records the complete location of the
diagnostic instead of just the line number.
 1.3 17-Jun-2022  rillig 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'.
 1.2 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.1 08-Apr-2021  rillig lint: in code from included files, print stack trace

Previously, the standard NetBSD build generated several lint warnings in
lhash.h from OpenSSL, without providing any hint as to which file
actually included that header. In cases like these, lint now interprets
the line number information in the preprocessor output from GCC to
reconstruct the exact include path to the file in question.

The program check-expect.lua had to be rewritten almost completely since
it assumed that all diagnostics would come from the main file. In all
existing tests, this was true, but these tests did not cover all cases
that occurred in practice. Now it records the complete location of the
diagnostic instead of just the line number.
 1.6 31-Jul-2025  rillig lint: fix return type of GCC's __atomic functions
 1.5 31-Jul-2025  rillig tests/lint: demonstrate wrong warning in GCC __atomic functions

Seen in GCC's libbacktrace, dwarf.c:3732.
 1.4 29-Aug-2024  rillig lint: support GCC's __auto_type

Fixes PR toolchain/58654.
 1.3 08-Jun-2024  rillig branches: 1.3.2;
tests/lint: group tests by topic
 1.2 08-Jun-2024  rillig lint: fix type of GCC-specific __FUNCTION__ to be an array
 1.1 08-Jun-2024  rillig tests/lint: reorganize tests

Tests for a single working language construct don't usually need a
separate file, they can be grouped together, like in expr.c or gcc.c.
 1.3.2.1 02-Aug-2025  perseant Sync with HEAD
 1.13 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.12 25-Aug-2022  rillig lint: remove explicit list of known GCC attributes

Most GCC attributes consist of a single identifier. Up to now, it was
necessary to list each of these identifiers in the grammar, even those
that only apply to a single target architecture.

Instead, parse the general form of attributes, matching the few
attributes that lint handles by name instead. While here, rename the
grammar rules to use the GCC terms.

To avoid conflicts between the global function 'printf' and the GCC
attribute of the same name, do not add GCC attributes to the symbol
table, and don't make these symbols 'extern' either.

ok christos@.
 1.11 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.10 15-Jul-2021  rillig tests/lint: cover more edge cases in the parser
 1.9 09-Jul-2021  rillig tests/lint: ensure that GCC __attribute__ can be parsed
 1.8 06-Jul-2021  rillig tests/lint: add test for empty __attribute__(())
 1.7 06-Jul-2021  rillig tests/lint: add tests for GCC __attribute__

Before fixing the wrong handling of __attribute__ that is demonstrated
at the end of gcc_attribute.c, ensure that the attribute handling works
in the most basic cases.

Lint currently accepts __attribute__ in more places than it should.
This leads to some ambiguities in the grammar.
 1.6 06-Jul-2021  rillig tests/lint: document wrong handling of GCC __attribute__
 1.5 03-May-2021  rillig lint: allow variables to be named 'pcs'
 1.4 03-May-2021  rillig tests/lint: demonstrate bug in the lexer for GCC attributes
 1.3 01-May-2021  rillig tests/lint: add test for __attribute__((nonnull()))
 1.2 01-May-2021  rillig lint: support all documented variants of __attribute__((nonnull))
 1.1 30-Apr-2021  rillig tests/lint: add very basic tests for GCC __attribute__
 1.8 17-Jun-2022  rillig 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'.
 1.7 15-Jul-2021  rillig tests/lint: cover more edge cases in the parser
 1.6 06-Jul-2021  rillig tests/lint: add tests for GCC __attribute__

Before fixing the wrong handling of __attribute__ that is demonstrated
at the end of gcc_attribute.c, ensure that the attribute handling works
in the most basic cases.

Lint currently accepts __attribute__ in more places than it should.
This leads to some ambiguities in the grammar.
 1.5 03-May-2021  rillig lint: allow variables to be named 'pcs'
 1.4 03-May-2021  rillig tests/lint: demonstrate bug in the lexer for GCC attributes
 1.3 01-May-2021  rillig tests/lint: add test for __attribute__((nonnull()))
 1.2 01-May-2021  rillig lint: support all documented variants of __attribute__((nonnull))
 1.1 30-Apr-2021  rillig tests/lint: add very basic tests for GCC __attribute__
 1.8 01-May-2024  rillig lint: fix size of struct with large alignment

Lint now successfully passes all compile-time assertions in the amd64
kernel that deal with struct sizes.
 1.7 01-May-2024  rillig lint: support _Alignas and __attribute__((__aligned(4)))
 1.6 07-Jul-2023  rillig 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.5 27-Aug-2022  rillig tests/lint: add more information to test for __attribute__((aligned))

Declaring an array type having a negative dimension is the simplest way
to embed an integer into a lint diagnostic, thereby revealing what size
and alignment lint has calculated for a struct.

While here, move these "compile-time assertions" closer to their
corresponding struct, to make reading easier.
 1.4 27-Aug-2022  rillig tests/lint: add another test for aligned struct member

In the kernel, several structs have this attribute, and running lint on
them runs into a compile-time assertion. Typical error messages are:

* error: illegal bit-field size: 255 [36]
* error: integral constant expression expected [55]
 1.3 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.2 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.1 02-May-2021  rillig tests/lint: demonstrate missing support for __packed __aligned
 1.3 17-Jun-2022  rillig 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'.
 1.2 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.1 02-May-2021  rillig tests/lint: demonstrate missing support for __packed __aligned
 1.6 16-May-2025  rillig tests/lint: test multiple attributes on enums, functions and labels

The grammar rule 'gcc_attribute_specifier_list:
gcc_attribute_specifier_list gcc_attribute_specifier' was not covered
before.
 1.5 17-Jun-2022  rillig branches: 1.5.4;
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 25-Jul-2021  rillig lint: fix parsing of enumerators with __attribute__
 1.3 25-Jul-2021  rillig lint: fix parsing of __attribute__ before enum tag

The __attribute__ after the enumerators will be fixed in a follow-up
commit since lint exits after the 5th syntax error in a translation
unit, which up to now shadowed the error messages about the enumerators.
 1.2 25-Jul-2021  rillig tests/lint: test __attribute__ with enum
 1.1 06-Jul-2021  rillig tests/lint: add tests for GCC __attribute__

Before fixing the wrong handling of __attribute__ that is demonstrated
at the end of gcc_attribute.c, ensure that the attribute handling works
in the most basic cases.

Lint currently accepts __attribute__ in more places than it should.
This leads to some ambiguities in the grammar.
 1.5.4.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 25-Jul-2021  rillig lint: fix parsing of enumerators with __attribute__
 1.3 25-Jul-2021  rillig lint: fix parsing of __attribute__ before enum tag

The __attribute__ after the enumerators will be fixed in a follow-up
commit since lint exits after the 5th syntax error in a translation
unit, which up to now shadowed the error messages about the enumerators.
 1.2 25-Jul-2021  rillig tests/lint: test __attribute__ with enum
 1.1 06-Jul-2021  rillig tests/lint: add tests for GCC __attribute__

Before fixing the wrong handling of __attribute__ that is demonstrated
at the end of gcc_attribute.c, ensure that the attribute handling works
in the most basic cases.

Lint currently accepts __attribute__ in more places than it should.
This leads to some ambiguities in the grammar.
 1.6 16-May-2025  rillig tests/lint: test multiple attributes on enums, functions and labels

The grammar rule 'gcc_attribute_specifier_list:
gcc_attribute_specifier_list gcc_attribute_specifier' was not covered
before.
 1.5 13-Nov-2024  rillig lint: handle _Noreturn, [[noreturn]] and __attribute__((__noreturn__))
 1.4 28-Mar-2023  rillig branches: 1.4.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.2 14-Jul-2021  rillig tests/lint: add several tests for edge cases in the grammar
 1.1 06-Jul-2021  rillig tests/lint: add tests for GCC __attribute__

Before fixing the wrong handling of __attribute__ that is demonstrated
at the end of gcc_attribute.c, ensure that the attribute handling works
in the most basic cases.

Lint currently accepts __attribute__ in more places than it should.
This leads to some ambiguities in the grammar.
 1.4.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.2 14-Jul-2021  rillig tests/lint: add several tests for edge cases in the grammar
 1.1 06-Jul-2021  rillig tests/lint: add tests for GCC __attribute__

Before fixing the wrong handling of __attribute__ that is demonstrated
at the end of gcc_attribute.c, ensure that the attribute handling works
in the most basic cases.

Lint currently accepts __attribute__ in more places than it should.
This leads to some ambiguities in the grammar.
 1.5 16-May-2025  rillig tests/lint: test multiple attributes on enums, functions and labels

The grammar rule 'gcc_attribute_specifier_list:
gcc_attribute_specifier_list gcc_attribute_specifier' was not covered
before.
 1.4 28-Mar-2023  rillig branches: 1.4.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 28-Apr-2022  rillig lint: revert resolving grammar conflicts for labeled statements

Restore the grammar rule for labeled_statement as it was before cgram.y
1.400 from 2022-04-24. This allows labels with attributes again. Fix
the wrong interpretation in the tests; the attributes belong to the
label, not to the statement.

Today in the morning, when I thought that the change in cgram.y 1.400
were innocent, I accidentally ran lint only with the options '-Sw' but
forgot the option '-g' for GNU mode. Without that option, the token
'__attribute__' is unknown, which unsurprisingly leads to lots of syntax
errors, and these didn't change with that commit. The actual change was
only visible in GNU mode.
 1.2 11-Jul-2021  rillig lint: support __attribute__((hot))

The corresponding attribute 'cold' was already added in cgram.y 1.84
from 2016-12-29.
 1.1 06-Jul-2021  rillig tests/lint: add tests for GCC __attribute__

Before fixing the wrong handling of __attribute__ that is demonstrated
at the end of gcc_attribute.c, ensure that the attribute handling works
in the most basic cases.

Lint currently accepts __attribute__ in more places than it should.
This leads to some ambiguities in the grammar.
 1.4.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 28-Apr-2022  rillig lint: revert resolving grammar conflicts for labeled statements

Restore the grammar rule for labeled_statement as it was before cgram.y
1.400 from 2022-04-24. This allows labels with attributes again. Fix
the wrong interpretation in the tests; the attributes belong to the
label, not to the statement.

Today in the morning, when I thought that the change in cgram.y 1.400
were innocent, I accidentally ran lint only with the options '-Sw' but
forgot the option '-g' for GNU mode. Without that option, the token
'__attribute__' is unknown, which unsurprisingly leads to lots of syntax
errors, and these didn't change with that commit. The actual change was
only visible in GNU mode.
 1.2 11-Jul-2021  rillig lint: support __attribute__((hot))

The corresponding attribute 'cold' was already added in cgram.y 1.84
from 2016-12-29.
 1.1 06-Jul-2021  rillig tests/lint: add tests for GCC __attribute__

Before fixing the wrong handling of __attribute__ that is demonstrated
at the end of gcc_attribute.c, ensure that the attribute handling works
in the most basic cases.

Lint currently accepts __attribute__ in more places than it should.
This leads to some ambiguities in the grammar.
 1.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 28-Apr-2022  rillig lint: revert resolving grammar conflicts for labeled statements

Restore the grammar rule for labeled_statement as it was before cgram.y
1.400 from 2022-04-24. This allows labels with attributes again. Fix
the wrong interpretation in the tests; the attributes belong to the
label, not to the statement.

Today in the morning, when I thought that the change in cgram.y 1.400
were innocent, I accidentally ran lint only with the options '-Sw' but
forgot the option '-g' for GNU mode. Without that option, the token
'__attribute__' is unknown, which unsurprisingly leads to lots of syntax
errors, and these didn't change with that commit. The actual change was
only visible in GNU mode.
 1.2 28-Apr-2022  rillig tests/lint: add test for GCC unused statement

Seen in xsrc/LRGB.c:799.

Even though it looks like this lint error may have been introduced by
cgram.y 1.400 from 2022-04-24 (since LRGB.c has been unchanged for a
month), earlier versions of lint produce the same parse errors.
 1.1 06-Jul-2021  rillig tests/lint: add tests for GCC __attribute__

Before fixing the wrong handling of __attribute__ that is demonstrated
at the end of gcc_attribute.c, ensure that the attribute handling works
in the most basic cases.

Lint currently accepts __attribute__ in more places than it should.
This leads to some ambiguities in the grammar.
 1.4 17-Jun-2022  rillig 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'.
 1.3 28-Apr-2022  rillig lint: revert resolving grammar conflicts for labeled statements

Restore the grammar rule for labeled_statement as it was before cgram.y
1.400 from 2022-04-24. This allows labels with attributes again. Fix
the wrong interpretation in the tests; the attributes belong to the
label, not to the statement.

Today in the morning, when I thought that the change in cgram.y 1.400
were innocent, I accidentally ran lint only with the options '-Sw' but
forgot the option '-g' for GNU mode. Without that option, the token
'__attribute__' is unknown, which unsurprisingly leads to lots of syntax
errors, and these didn't change with that commit. The actual change was
only visible in GNU mode.
 1.2 28-Apr-2022  rillig tests/lint: add test for GCC unused statement

Seen in xsrc/LRGB.c:799.

Even though it looks like this lint error may have been introduced by
cgram.y 1.400 from 2022-04-24 (since LRGB.c has been unchanged for a
month), earlier versions of lint produce the same parse errors.
 1.1 06-Jul-2021  rillig tests/lint: add tests for GCC __attribute__

Before fixing the wrong handling of __attribute__ that is demonstrated
at the end of gcc_attribute.c, ensure that the attribute handling works
in the most basic cases.

Lint currently accepts __attribute__ in more places than it should.
This leads to some ambiguities in the grammar.
 1.4 05-Feb-2023  rillig tests/lint: clean up

The .exp files are no longer kept under version control, so there's no
reason anymore to forcefully trigger a warning or an error.
 1.3 25-Aug-2022  rillig lint: remove explicit list of known GCC attributes

Most GCC attributes consist of a single identifier. Up to now, it was
necessary to list each of these identifiers in the grammar, even those
that only apply to a single target architecture.

Instead, parse the general form of attributes, matching the few
attributes that lint handles by name instead. While here, rename the
grammar rules to use the GCC terms.

To avoid conflicts between the global function 'printf' and the GCC
attribute of the same name, do not add GCC attributes to the symbol
table, and don't make these symbols 'extern' either.

ok christos@.
 1.2 25-Jul-2021  rillig lint: reorder grammar rules

First the base cases, then the extensions, like in most other rules in
this file.

No functional change.
 1.1 06-Jul-2021  rillig tests/lint: add tests for GCC __attribute__

Before fixing the wrong handling of __attribute__ that is demonstrated
at the end of gcc_attribute.c, ensure that the attribute handling works
in the most basic cases.

Lint currently accepts __attribute__ in more places than it should.
This leads to some ambiguities in the grammar.
 1.3 17-Jun-2022  rillig 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'.
 1.2 25-Jul-2021  rillig lint: reorder grammar rules

First the base cases, then the extensions, like in most other rules in
this file.

No functional change.
 1.1 06-Jul-2021  rillig tests/lint: add tests for GCC __attribute__

Before fixing the wrong handling of __attribute__ that is demonstrated
at the end of gcc_attribute.c, ensure that the attribute handling works
in the most basic cases.

Lint currently accepts __attribute__ in more places than it should.
This leads to some ambiguities in the grammar.
 1.13 28-Sep-2024  rillig lint: handle __attribute__((__unused__)) for functions and variables

Previously, lint ignored the '__unused' marker, requiring its own /*
ARGSUSED */ marker instead.

Previously, attributes were interpreted as soon as the closing
parenthesis was parsed. For a function definition such as '__unused
static void f(void) {}', this was too early, as the attribute was not
connected to the function, as the function was not parsed yet.

Now, the 'unused' attribute is passed around by the parser, until it is
merged into the declarator where it belongs. Due to an inaccuracy in
the grammar, the 'used' attribute has to be passed through a
parameter_list, even though a parameter list is not related to
attributes. Still, it's better than before.
 1.12 28-Sep-2024  rillig lint: reduce shift/reduce conflicts in grammar

In an anonymous member declaration, the type attributes are already
parsed by the type specifier.
 1.11 15-Jul-2023  rillig branches: 1.11.2;
lint: each member declarator may have attributes, not only the last one
 1.10 15-Jul-2023  rillig tests/lint: test GCC attributes in member declarations
 1.9 07-Jul-2023  rillig lint: only skip 'unused' warnings after errors, not other warnings

Previously, in -w mode, any warning suppressed further 'unused'
warnings, even though there was no need to do that. This can be seen in
the test gcc_attribute_var.c, where only the last unused variable from a
function was marked as unused, the others slipped through.

Fixed by counting the errors and the warnings separately and only
combining them if actually desired.
 1.8 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.7 05-Feb-2023  rillig tests/lint: clean up

The .exp files are no longer kept under version control, so there's no
reason anymore to forcefully trigger a warning or an error.
 1.6 25-Aug-2022  rillig lint: remove explicit list of known GCC attributes

Most GCC attributes consist of a single identifier. Up to now, it was
necessary to list each of these identifiers in the grammar, even those
that only apply to a single target architecture.

Instead, parse the general form of attributes, matching the few
attributes that lint handles by name instead. While here, rename the
grammar rules to use the GCC terms.

To avoid conflicts between the global function 'printf' and the GCC
attribute of the same name, do not add GCC attributes to the symbol
table, and don't make these symbols 'extern' either.

ok christos@.
 1.5 11-Aug-2021  rillig lint: allow GCC __attribute__ after array brackets

GCC accepts this, so should lint. Seen in pam_lastlog.c:115.
 1.4 11-Aug-2021  rillig tests/lint: demonstrate wrong 'syntax error' for unused argument

Seen in pam_chroot.c:60.
 1.3 11-Jul-2021  rillig lint: fix bug when parsing unused variable (since 2021-07-10)

Partially revert to cgram.y 1.248 from 2021-06-29.

This fixes the parse error for variables whose declaration starts with
__attribute__((unused)). In the many refactorings of the last days this
bug has slipped in, and since there were several refactorings in that
area, there may be have been further bugs that are not caught by the
current test suite. Revert for now and maybe apply them later again
when there are more tests.

Things kept from the current version are:

The names of most of the rules, as they correspond more closely to C99
and do not affect the behavior in any way.

In type_direct_decl, the replacement of type_attribute_list with
type_attribute since that nonterminal is already part of a repetition
(saves 4 conflicts).

In block_item, the order of the rules corresponds to C99. This has no
influence on the generated parser, except for the rule numbers, which
are informative.

The merge of the duplicate code for struct_tag, enum_tag and
enum_constant, as they all contained exactly the same code.
 1.2 11-Jul-2021  rillig tests/lint: analyze yesterday's bug for parsing declarations
 1.1 06-Jul-2021  rillig tests/lint: add tests for GCC __attribute__

Before fixing the wrong handling of __attribute__ that is demonstrated
at the end of gcc_attribute.c, ensure that the attribute handling works
in the most basic cases.

Lint currently accepts __attribute__ in more places than it should.
This leads to some ambiguities in the grammar.
 1.11.2.1 02-Aug-2025  perseant Sync with HEAD
 1.6 17-Jun-2022  rillig 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'.
 1.5 11-Aug-2021  rillig lint: allow GCC __attribute__ after array brackets

GCC accepts this, so should lint. Seen in pam_lastlog.c:115.
 1.4 11-Aug-2021  rillig tests/lint: demonstrate wrong 'syntax error' for unused argument

Seen in pam_chroot.c:60.
 1.3 11-Jul-2021  rillig lint: fix bug when parsing unused variable (since 2021-07-10)

Partially revert to cgram.y 1.248 from 2021-06-29.

This fixes the parse error for variables whose declaration starts with
__attribute__((unused)). In the many refactorings of the last days this
bug has slipped in, and since there were several refactorings in that
area, there may be have been further bugs that are not caught by the
current test suite. Revert for now and maybe apply them later again
when there are more tests.

Things kept from the current version are:

The names of most of the rules, as they correspond more closely to C99
and do not affect the behavior in any way.

In type_direct_decl, the replacement of type_attribute_list with
type_attribute since that nonterminal is already part of a repetition
(saves 4 conflicts).

In block_item, the order of the rules corresponds to C99. This has no
influence on the generated parser, except for the rule numbers, which
are informative.

The merge of the duplicate code for struct_tag, enum_tag and
enum_constant, as they all contained exactly the same code.
 1.2 11-Jul-2021  rillig tests/lint: analyze yesterday's bug for parsing declarations
 1.1 06-Jul-2021  rillig tests/lint: add tests for GCC __attribute__

Before fixing the wrong handling of __attribute__ that is demonstrated
at the end of gcc_attribute.c, ensure that the attribute handling works
in the most basic cases.

Lint currently accepts __attribute__ in more places than it should.
This leads to some ambiguities in the grammar.
 1.10 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.9 28-Mar-2023  rillig branches: 1.9.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.8 28-Jan-2023  rillig tests/lint: document how compilers promote bit-fields
 1.7 28-Jan-2023  rillig tests/lint: investigate how compilers interpret bit-fields
 1.6 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.5 04-May-2021  rillig lint: fix assertion failure when promoting a bit-field larger than int
 1.4 04-May-2021  rillig tests/lint: demonstrate assertion failure "len == size_in_bits(INT)"

Seen on sparc64 in hdtoa.c:341 since sparc64 is one of the platforms
that has 128-bit long double and defines struct ieee_ext.ext_frach:48
based on uint64_t, which is a GCC extension. Plain C99 only allows
_Bool, signed int and unsigned int as base type for bit-fields.
 1.3 02-May-2021  rillig lint: allow large integer types for bit-fields in GCC mode

These types are explicitly allowed by GCC.

I'm not sure which of the flags -g and -p should be stronger. That is,
if both -g and -p are given, should 'unsigned char' be allowed as a
bit-field type since -g would allow it, or should it be warned about
since -p warns about it? For now, continue to warn about these.
 1.2 02-May-2021  rillig tests/lint: fix test for GCC bit-field types

The whole purpose of this test is to try the message about invalid
bit-field types in GCC mode. Therefore, use the default lint1-flags
that include -g.
 1.1 02-May-2021  rillig tests/lint: add test for bit-field types in GCC mode
 1.9.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.3 02-May-2021  rillig lint: allow large integer types for bit-fields in GCC mode

These types are explicitly allowed by GCC.

I'm not sure which of the flags -g and -p should be stronger. That is,
if both -g and -p are given, should 'unsigned char' be allowed as a
bit-field type since -g would allow it, or should it be warned about
since -p warns about it? For now, continue to warn about these.
 1.2 02-May-2021  rillig tests/lint: fix test for GCC bit-field types

The whole purpose of this test is to try the message about invalid
bit-field types in GCC mode. Therefore, use the default lint1-flags
that include -g.
 1.1 02-May-2021  rillig tests/lint: add test for bit-field types in GCC mode
 1.6 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.5 20-Feb-2025  rillig lint: mention the assignment operator in 'illegal combination'

In source lines that contain both a 'return' statement as well as a
function-like macro, such as the C11 atomics, seeing the word 'init' in
the diagnostic helps to see that the type conflict is not in the
'return' statement but instead in some initializer.

Seen in userspace-rcu/wfcqueue.h:147.
 1.4 07-Jul-2023  rillig branches: 1.4.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.3 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.2 06-Dec-2021  rillig lint: fix return type of GCC's __builtin_alloca

Needed for libgmp.
 1.1 06-Dec-2021  rillig tests/lint: demonstrate wrong warning for __builtin_alloca
 1.4.2.1 02-Aug-2025  perseant Sync with HEAD
 1.3 17-Jun-2022  rillig 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'.
 1.2 06-Dec-2021  rillig lint: fix return type of GCC's __builtin_alloca

Needed for libgmp.
 1.1 06-Dec-2021  rillig tests/lint: demonstrate wrong warning for __builtin_alloca
 1.3 07-Jul-2023  rillig 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.2 03-Sep-2021  rillig lint: set the return type of __builtin_*_overflow to bool, not int

Needed for inetd.c in strict bool mode.
 1.1 03-Sep-2021  rillig tests/lint: test GCC builtins for overflow in strict bool mode

Seen in inetd.c.
 1.3 17-Jun-2022  rillig 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'.
 1.2 03-Sep-2021  rillig lint: set the return type of __builtin_*_overflow to bool, not int

Needed for inetd.c in strict bool mode.
 1.1 03-Sep-2021  rillig tests/lint: test GCC builtins for overflow in strict bool mode

Seen in inetd.c.
 1.4 07-Jul-2023  rillig 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.3 03-Aug-2021  rillig lint: in strict enum mode, error out on enum type mismatch in union cast
 1.2 03-Aug-2021  rillig lint: merge almost duplicate code from 'sametype' into 'eqtype'

In 'sametype', the branch for comparing array types was unreachable
since it requires both tspecs to be the same, but t2 underwent the
array-to-pointer conversion.

Previously, lint warned about enum type mismatches, even without -e for
strict enum mode. Instead, it got the case for 'char *' wrong, which is
now fixed. Now lint behaves like GCC 10.3.0 in this regard. The
warning about enum mismatch is useful though, so it may be re-added in a
future commit.
 1.1 03-Aug-2021  rillig tests/lint: test GCC extension for casting to union type
 1.4 17-Jun-2022  rillig 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'.
 1.3 03-Aug-2021  rillig lint: in strict enum mode, error out on enum type mismatch in union cast
 1.2 03-Aug-2021  rillig lint: merge almost duplicate code from 'sametype' into 'eqtype'

In 'sametype', the branch for comparing array types was unreachable
since it requires both tspecs to be the same, but t2 underwent the
array-to-pointer conversion.

Previously, lint warned about enum type mismatches, even without -e for
strict enum mode. Instead, it got the case for 'char *' wrong, which is
now fixed. Now lint behaves like GCC 10.3.0 in this regard. The
warning about enum mismatch is useful though, so it may be re-added in a
future commit.
 1.1 03-Aug-2021  rillig tests/lint: test GCC extension for casting to union type
 1.8 29-Jul-2023  rillig lint: condense code for ending a function

No functional change.
 1.7 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.6 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.5 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.4 18-Apr-2021  rillig tests/lint: remove work-in-progress code

The only purpose of the additional initializers was to generate an error
message, to make the .exp file non-empty. This is no longer needed.
 1.3 17-Apr-2021  rillig lint: fix assertion failure for temporary objects in initialization
 1.2 17-Apr-2021  rillig tests/lint: fix analysis from previous commit, add another example

This is not a GCC feature, it's required by C99 already.
 1.1 17-Apr-2021  rillig tests/lint: demonstrate assertion failure in initialization
 1.6 17-Jun-2022  rillig 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'.
 1.5 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.4 18-Apr-2021  rillig tests/lint: remove work-in-progress code

The only purpose of the additional initializers was to generate an error
message, to make the .exp file non-empty. This is no longer needed.
 1.3 17-Apr-2021  rillig lint: fix assertion failure for temporary objects in initialization
 1.2 17-Apr-2021  rillig tests/lint: fix analysis from previous commit, add another example

This is not a GCC feature, it's required by C99 already.
 1.1 17-Apr-2021  rillig tests/lint: demonstrate assertion failure in initialization
 1.3 15-Jul-2023  rillig lint: fix member lookup after GCC statement expression
 1.2 15-Jul-2023  rillig lint: fix use-after-free bug in GCC statement expressions
 1.1 15-Jul-2023  rillig tests/lint: demonstrate use-after-free in GCC statement expression
 1.5 07-Jul-2023  rillig 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.4 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.3 21-Jul-2021  rillig lint: rename ignore_up_to_rparen to match the grammar rule

No functional change.
 1.2 15-Jul-2021  rillig tests/lint: cover more edge cases in the parser
 1.1 14-Jul-2021  rillig tests/lint: add several tests for edge cases in the grammar
 1.3 17-Jun-2022  rillig 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'.
 1.2 15-Jul-2021  rillig tests/lint: cover more edge cases in the parser
 1.1 14-Jul-2021  rillig tests/lint: add several tests for edge cases in the grammar
 1.7 02-Aug-2023  rillig lint: distinguish between arguments and parameters
 1.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 21-Jan-2023  rillig lint: fix null pointer dereference on invalid argument to __typeof__
 1.4 10-Apr-2022  rillig lint: fix assertion failure on duplicate qualifiers from __typeof__
 1.3 25-Jul-2021  rillig lint: do not parse 'typeof(0)(void)' as function call

Previously, lint tried to parse 'typeof(0)(void)' as 'typeof'
'(0)(void)', which tries to call 0 as a function.
 1.2 25-Jul-2021  rillig tests/lint: document parse error for GCC typeof
 1.1 25-Jul-2021  rillig tests/lint: demonstrate missing support for GCC typeof
 1.4 17-Jun-2022  rillig 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'.
 1.3 25-Jul-2021  rillig lint: do not parse 'typeof(0)(void)' as function call

Previously, lint tried to parse 'typeof(0)(void)' as 'typeof'
'(0)(void)', which tries to call 0 as a function.
 1.2 25-Jul-2021  rillig tests/lint: document parse error for GCC typeof
 1.1 25-Jul-2021  rillig tests/lint: demonstrate missing support for GCC typeof
 1.7 08-Jun-2024  rillig tests/lint: group tests by topic
 1.6 07-Jul-2023  rillig 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.5 05-Feb-2023  rillig tests/lint: clean up

The .exp files are no longer kept under version control, so there's no
reason anymore to forcefully trigger a warning or an error.
 1.4 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.3 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.2 03-May-2021  rillig lint: fix parsing of __typeof__ after statement in ({ ... })

Since C99, declarations and statements can be freely mixed, and GCC
supported this even before 1999.
 1.1 22-Apr-2021  rillig tests/lint: add test for typeof after statement

Found by christos@.
 1.3 17-Jun-2022  rillig 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'.
 1.2 03-May-2021  rillig lint: fix parsing of __typeof__ after statement in ({ ... })

Since C99, declarations and statements can be freely mixed, and GCC
supported this even before 1999.
 1.1 22-Apr-2021  rillig tests/lint: add test for typeof after statement

Found by christos@.
 1.2 05-Jul-2023  rillig tests/lint: spell platform identifiers for 'long double' consistently

The test file names don't have a hyphen, so the identifiers shouldn't
have one either.
 1.1 10-Oct-2021  rillig tests/lint: remove duplicate platform, generate platforms list

It was an unreliable idea to extract the platform properties from the
targparam.h files manually, even if it was a one-time job. I still made
a mistake by accidentally marking aarch64 as schar, even though it is
uchar, plus I duplicated the line for powerpc64.

Remove the duplicate line, no functional change.
 1.18 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.17 20-Feb-2025  rillig lint: mention the assignment operator in 'illegal combination'

In source lines that contain both a 'return' statement as well as a
function-like macro, such as the C11 atomics, seeing the word 'init' in
the diagnostic helps to see that the type conflict is not in the
'return' statement but instead in some initializer.

Seen in userspace-rcu/wfcqueue.h:147.
 1.16 08-Jun-2024  rillig branches: 1.16.2;
tests/lint: group tests by topic
 1.15 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.14 04-Jan-2023  rillig tests/lint: remove obsolete comments

The handling of initializers was completely rewritten in init.c 1.228
from 2021-12-21.
 1.13 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.12 19-Jun-2022  rillig tests/lint: add quotes around placeholders in a few messages
 1.11 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.10 22-Dec-2021  rillig lint: fix handling of initializations

The implementation from March 2021 added proper support for designators
but didn't model the brace levels correctly. In particular, it could
not handle additional braces or omitted braces. In such a case, lint
skipped the remaining initializers from the initialization. Due to
this, type errors in the remaining initializers went unnoticed. Another
effect was that arrays of unknown size were wrongly reported as having
size 0.

Both GCC and Clang recommend placing braces around each sub-type that is
initialized, such as a struct, union or array. Postfix does not follow
these recommendations, therefore lint had to be disabled in
external/ibm-public/postfix/Makefile.inc. This commit fixes the bugs
mentioned there.
 1.9 21-Dec-2021  rillig lint: treat incomplete union in the same way as incomplete struct

The newly added tests triggered the assertion in begin_designation since
for incomplete types the initialization is stopped before handling the
first brace.
 1.8 21-Dec-2021  rillig tests/lint: test initialization of incomplete union

The function initialization_lbrace only mentions STRUCT, which looks
suspicious.
 1.7 17-Dec-2021  rillig lint: fix initialization with few braces from function

Seen in Postfix, smtp_proto.c.
 1.6 17-Dec-2021  rillig tests/lint: demonstrate another initialization with few braces

Seen in Postfix, smtp_proto.c.
 1.5 17-Dec-2021  rillig lint: fix initialization of array with fewer braces

Seen in Postfix, cleanup_strerror.c.
 1.4 17-Dec-2021  rillig tests/lint: demonstrate another initialization that lint cannot handle

Seen in external/ibm-public/postfix/dist/src/global/cleanup_strerror.c.
 1.3 17-Dec-2021  rillig lint: work around lint bug in initialization with few braces

Needs a proper fix later, but for now, this workaround allows to run
lint on Postfix again.
 1.2 17-Dec-2021  rillig lint: demonstrate wrong error message in initialization

History of the new test fragment:

libexec/2021.09.14.19.44.40-plain/lint1
| (14): error: cannot initialize 'struct typedef histogram_entry'
| from 'pointer to char' [185]
| exit status 1
libexec/2021.04.01.14.20.30-plain/lint1

libexec/2021.03.30.20.23.30-plain/lint1
| (14): error: cannot initialize 'struct typedef histogram_entry'
| from 'pointer to char' [185]
| (14): error: cannot initialize 'struct typedef histogram_entry'
| from 'int' [185]
| (15): error: cannot initialize 'struct typedef histogram_entry'
| from 'pointer to char' [185]
| (15): error: cannot initialize 'struct typedef histogram_entry'
| from 'int' [185]
| exit status 1
libexec/2021.03.30.14.25.28-plain/lint1

libexec/2021.03.29.21.34.17-plain/lint1
| (15): error: too many struct/union initializers [172]
| exit status 1
libexec/2021.03.28.15.36.37-plain/lint1

libexec/2021.03.28.14.13.18-plain/lint1
| (18): error: too many struct/union initializers [172]
| exit status 1
libexec/2021.03.21.20.44.59-plain/lint1

libexec/2021.03.21.20.30.19-plain/lint1
| (18): too many struct/union initializers [172]
| exit status 1
libexec/2014.11.20.20.49.06-plain/lint1

libexec/2014.11.20.20.48.33-plain/lint1
| exit status 0
 1.1 10-Jul-2021  rillig tests/lint: add more tests for covering the grammar
 1.16.2.1 02-Aug-2025  perseant Sync with HEAD
 1.12 17-Jun-2022  rillig 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'.
 1.11 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.10 22-Dec-2021  rillig lint: fix handling of initializations

The implementation from March 2021 added proper support for designators
but didn't model the brace levels correctly. In particular, it could
not handle additional braces or omitted braces. In such a case, lint
skipped the remaining initializers from the initialization. Due to
this, type errors in the remaining initializers went unnoticed. Another
effect was that arrays of unknown size were wrongly reported as having
size 0.

Both GCC and Clang recommend placing braces around each sub-type that is
initialized, such as a struct, union or array. Postfix does not follow
these recommendations, therefore lint had to be disabled in
external/ibm-public/postfix/Makefile.inc. This commit fixes the bugs
mentioned there.
 1.9 21-Dec-2021  rillig lint: treat incomplete union in the same way as incomplete struct

The newly added tests triggered the assertion in begin_designation since
for incomplete types the initialization is stopped before handling the
first brace.
 1.8 21-Dec-2021  rillig tests/lint: test initialization of incomplete union

The function initialization_lbrace only mentions STRUCT, which looks
suspicious.
 1.7 17-Dec-2021  rillig lint: fix initialization with few braces from function

Seen in Postfix, smtp_proto.c.
 1.6 17-Dec-2021  rillig tests/lint: demonstrate another initialization with few braces

Seen in Postfix, smtp_proto.c.
 1.5 17-Dec-2021  rillig lint: fix initialization of array with fewer braces

Seen in Postfix, cleanup_strerror.c.
 1.4 17-Dec-2021  rillig tests/lint: demonstrate another initialization that lint cannot handle

Seen in external/ibm-public/postfix/dist/src/global/cleanup_strerror.c.
 1.3 17-Dec-2021  rillig lint: work around lint bug in initialization with few braces

Needs a proper fix later, but for now, this workaround allows to run
lint on Postfix again.
 1.2 17-Dec-2021  rillig lint: demonstrate wrong error message in initialization

History of the new test fragment:

libexec/2021.09.14.19.44.40-plain/lint1
| (14): error: cannot initialize 'struct typedef histogram_entry'
| from 'pointer to char' [185]
| exit status 1
libexec/2021.04.01.14.20.30-plain/lint1

libexec/2021.03.30.20.23.30-plain/lint1
| (14): error: cannot initialize 'struct typedef histogram_entry'
| from 'pointer to char' [185]
| (14): error: cannot initialize 'struct typedef histogram_entry'
| from 'int' [185]
| (15): error: cannot initialize 'struct typedef histogram_entry'
| from 'pointer to char' [185]
| (15): error: cannot initialize 'struct typedef histogram_entry'
| from 'int' [185]
| exit status 1
libexec/2021.03.30.14.25.28-plain/lint1

libexec/2021.03.29.21.34.17-plain/lint1
| (15): error: too many struct/union initializers [172]
| exit status 1
libexec/2021.03.28.15.36.37-plain/lint1

libexec/2021.03.28.14.13.18-plain/lint1
| (18): error: too many struct/union initializers [172]
| exit status 1
libexec/2021.03.21.20.44.59-plain/lint1

libexec/2021.03.21.20.30.19-plain/lint1
| (18): too many struct/union initializers [172]
| exit status 1
libexec/2014.11.20.20.49.06-plain/lint1

libexec/2014.11.20.20.48.33-plain/lint1
| exit status 0
 1.1 10-Jul-2021  rillig tests/lint: add more tests for covering the grammar
 1.11 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.10 20-Feb-2025  rillig lint: mention the assignment operator in 'illegal combination'

In source lines that contain both a 'return' statement as well as a
function-like macro, such as the C11 atomics, seeing the word 'init' in
the diagnostic helps to see that the type conflict is not in the
'return' statement but instead in some initializer.

Seen in userspace-rcu/wfcqueue.h:147.
 1.9 21-Jul-2023  rillig branches: 1.9.2;
lint: reword message about non-constant initializer
 1.8 07-Jul-2023  rillig 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.7 01-Jul-2023  rillig lint: fix initialization of unnamed union member
 1.6 30-Jun-2023  rillig tests/lint: test initializing an unnamed union
 1.5 30-Jun-2023  rillig lint: fix handling of unnamed struct/union members

The support for unnamed struct/union members that was added in decl.c
1.60 from 2015-10-13 was simple but wrong. It didn't cover initializers
of these structures and computed wrong sizes for structures containing
anonymous unions. At that time, the handling of initializers was broken
as well, it was fixed 6 years later in init.c 1.229 from 2021-12-22.

Real-life examples for code that lint couldn't handle are:

* external/bsd/jemalloc/dist/src/jemalloc.c
* external/mit/xorg/lib/dri.old/Makefile
 1.4 30-Jun-2023  rillig tests/lint: add more tests for sizeof, offsetof, alignof
 1.3 28-Jun-2023  rillig tests/lint: demonstrate wrong handling of nested initializer

Seen in external/bsd/jemalloc/dist/src/jemalloc.c, init_lock.
 1.2 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.1 20-Dec-2021  rillig tests/lint: test excess braces around initializers
 1.9.2.1 02-Aug-2025  perseant Sync with HEAD
 1.2 17-Jun-2022  rillig 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'.
 1.1 20-Dec-2021  rillig tests/lint: test excess braces around initializers
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 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.3 27-Feb-2022  rillig lint: C99 has been released, so refer to it by its proper name
 1.2 14-Jul-2021  rillig tests/lint: add several tests for edge cases in the grammar
 1.1 10-Jul-2021  rillig tests/lint: add more tests for covering the grammar
 1.4 17-Jun-2022  rillig 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'.
 1.3 27-Feb-2022  rillig lint: C99 has been released, so refer to it by its proper name
 1.2 14-Jul-2021  rillig tests/lint: add several tests for edge cases in the grammar
 1.1 10-Jul-2021  rillig tests/lint: add more tests for covering the grammar
 1.5 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.4 27-Feb-2025  rillig lint: normalize whitespace
 1.3 20-Feb-2025  rillig lint: mention the assignment operator in 'illegal combination'

In source lines that contain both a 'return' statement as well as a
function-like macro, such as the C11 atomics, seeing the word 'init' in
the diagnostic helps to see that the type conflict is not in the
'return' statement but instead in some initializer.

Seen in userspace-rcu/wfcqueue.h:147.
 1.2 09-Jun-2024  rillig branches: 1.2.2;
lint: warn about lossy floating point constant to integer conversions
 1.1 08-Jun-2024  rillig tests/lint: group tests by topic
 1.2.2.1 02-Aug-2025  perseant Sync with HEAD
 1.6 05-Nov-2024  rillig lint: fix cross references in comments
 1.5 08-Jun-2024  rillig branches: 1.5.2;
tests/lint: group tests by topic
 1.4 08-Jun-2024  rillig tests/lint: reorganize tests

Tests for a single working language construct don't usually need a
separate file, they can be grouped together, like in expr.c or gcc.c.
 1.3 28-Mar-2024  rillig lint: clean up
 1.2 06-Aug-2023  rillig lint: since C99, a non-void function must return a value
 1.1 06-Aug-2023  rillig tests/lint: document how much of C99 lint already implements
 1.5.2.1 02-Aug-2025  perseant Sync with HEAD
 1.9 02-Feb-2024  rillig tests/lint: test lexing of characters and strings
 1.8 19-Jan-2024  rillig lint: allow '\e' only in GCC mode
 1.7 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.6 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.5 01-Apr-2022  rillig tests/lint: fix comment about backslash-newline
 1.4 29-Jun-2021  rillig tests/lint: add test for character constant using backslash-newline
 1.3 29-Jun-2021  rillig tests/lint: add tests for the lexical analysis
 1.2 20-Jun-2021  rillig tests/lint: remove outdated comment about '\0'

That comment was only needed for lex.c 1.38 from 2021-06-18, which was
fixed with lex.c 1.39 from 2021-06-19, just a day later.
 1.1 19-Jun-2021  rillig tests/lint: add test cases for lexical analysis
 1.4 17-Jun-2022  rillig 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'.
 1.3 29-Jun-2021  rillig tests/lint: add tests for the lexical analysis
 1.2 20-Jun-2021  rillig tests/lint: remove outdated comment about '\0'

That comment was only needed for lex.c 1.38 from 2021-06-18, which was
fixed with lex.c 1.39 from 2021-06-19, just a day later.
 1.1 19-Jun-2021  rillig tests/lint: add test cases for lexical analysis
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 21-Aug-2021  rillig tests/lint: guard against typos in test environment configuration

Some tests had "lint1-only-if" without a trailing colon, others included
the trailing colon. The tests that included the trailing colon were run
even though they were supposed to be skipped, and they failed, as could
be expected.

To prevent further typos, always require the trailing colon, just as in
"lint1-flags" and fail fast on unknown "lint1" comments.
 1.3 29-Jun-2021  rillig lint: fix wrong warning about out-of-range value '\xff' for char

This only affects platforms where char has the same representation as
unsigned char.
 1.2 29-Jun-2021  rillig lint: document where to fix the wrong warning for '\xff'
 1.1 29-Jun-2021  rillig tests/lint: add test that only runs where char == unsigned char

There a 4 regular NetBSD builds where lint is activated. All these
builds run on platforms where char == signed char.

The official test runs from https://releng.netbsd.org/test-results.html
mostly have char == signed char as well.

However, lint behaves differently on platforms with char == unsigned
char. On these platforms, a simple "char ch = '\xff'" leads to the
bogus warning that "conversion of 'int' to 'char' is out of range".
 1.3 29-Jun-2021  rillig lint: fix wrong warning about out-of-range value '\xff' for char

This only affects platforms where char has the same representation as
unsigned char.
 1.2 29-Jun-2021  rillig lint: document where to fix the wrong warning for '\xff'
 1.1 29-Jun-2021  rillig tests/lint: add test that only runs where char == unsigned char

There a 4 regular NetBSD builds where lint is activated. All these
builds run on platforms where char == signed char.

The official test runs from https://releng.netbsd.org/test-results.html
mostly have char == signed char as well.

However, lint behaves differently on platforms with char == unsigned
char. On these platforms, a simple "char ch = '\xff'" leads to the
bogus warning that "conversion of 'int' to 'char' is out of range".
 1.3 04-Oct-2024  rillig lint: fix suppressed warnings after if-else-if statement

Seen in sbin/dump/main.c, the "cp = strchr" line.

The bug had been there since at least 2002.
 1.2 04-Oct-2024  rillig tests/lint: demonstrate ignored LINTED comment after if-else-if
 1.1 19-Jun-2021  rillig branches: 1.1.4;
lint: fix endless loop on unfinished comment at EOF

Found using afl.
 1.1.4.1 02-Aug-2025  perseant Sync with HEAD
 1.2 17-Jun-2022  rillig 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'.
 1.1 19-Jun-2021  rillig lint: fix endless loop on unfinished comment at EOF

Found using afl.
 1.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 18-Feb-2023  rillig lint: remove compat code for lexing hex floating point literals

Hex floating literals are required by C99.
 1.2 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.1 19-Jun-2021  rillig tests/lint: add test cases for lexical analysis
 1.3 17-Jun-2022  rillig 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'.
 1.2 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.1 19-Jun-2021  rillig tests/lint: add test cases for lexical analysis
 1.11 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.10 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.9 28-Aug-2021  rillig tests/lint: test parsing of octal integer constants
 1.8 28-Aug-2021  rillig tests/lint: test parsing of integer constants

The previous version of this test did not focus on the integer constants
but instead on conversions of function arguments. The current test
covers several corner cases, such as non-decimal bases and all
combinations of suffixes.

This test does not cover lex_integer_constant completely since several
code paths are only reachable on 32-bit target platforms.
 1.7 21-Aug-2021  rillig tests/lint: guard against typos in test environment configuration

Some tests had "lint1-only-if" without a trailing colon, others included
the trailing colon. The tests that included the trailing colon were run
even though they were supposed to be skipped, and they failed, as could
be expected.

To prevent further typos, always require the trailing colon, just as in
"lint1-flags" and fail fast on unknown "lint1" comments.
 1.6 13-Jul-2021  rillig tests/lint: test binary integer literals and underscores
 1.5 10-Jul-2021  rillig tests/lint: test lexing of integer suffixes
 1.4 29-Jun-2021  rillig tests/lint: add test that only runs where char == unsigned char

There a 4 regular NetBSD builds where lint is activated. All these
builds run on platforms where char == signed char.

The official test runs from https://releng.netbsd.org/test-results.html
mostly have char == signed char as well.

However, lint behaves differently on platforms with char == unsigned
char. On these platforms, a simple "char ch = '\xff'" leads to the
bogus warning that "conversion of 'int' to 'char' is out of range".
 1.3 29-Jun-2021  rillig tests/lint: allow tests to be skipped depending on platform properties
 1.2 27-Jun-2021  rillig tests/lint: allow skipping individual tests

Depending on the platform, some tests do not make sense or produce
platform-dependent results. Allow these tests to be marked as such.

For example, the test lex_integer.c only works on 64-bit platforms.
Therefore it is disabled on i386 for now since it prints different
warnings there. Even better would be a "lint1-only-on-lpi32" toggle,
but that would need detection of 'sizeof(int)' at runtime.
 1.1 19-Jun-2021  rillig tests/lint: add test cases for lexical analysis
 1.5 17-Jun-2022  rillig 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'.
 1.4 28-Aug-2021  rillig tests/lint: test parsing of octal integer constants
 1.3 28-Aug-2021  rillig tests/lint: test parsing of integer constants

The previous version of this test did not focus on the integer constants
but instead on conversions of function arguments. The current test
covers several corner cases, such as non-decimal bases and all
combinations of suffixes.

This test does not cover lex_integer_constant completely since several
code paths are only reachable on 32-bit target platforms.
 1.2 27-Jun-2021  rillig tests/lint: allow skipping individual tests

Depending on the platform, some tests do not make sense or produce
platform-dependent results. Allow these tests to be marked as such.

For example, the test lex_integer.c only works on 64-bit platforms.
Therefore it is disabled on i386 for now since it prints different
warnings there. Even better would be a "lint1-only-on-lpi32" toggle,
but that would need detection of 'sizeof(int)' at runtime.
 1.1 19-Jun-2021  rillig tests/lint: add test cases for lexical analysis
 1.3 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.2 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.1 13-Jul-2021  rillig tests/lint: test binary integer literals and underscores
 1.2 17-Jun-2022  rillig 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'.
 1.1 13-Jul-2021  rillig tests/lint: test binary integer literals and underscores
 1.9 28-Jan-2024  rillig tests/lint: fix tests for integer constants on ILP32 platforms

The comment in msg_218 was both off-topic and wrong, so remove it.
 1.8 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.7 19-Feb-2023  rillig tests/lint: fix and extend tests for C90 migration warning
 1.6 05-Feb-2023  rillig tests/lint: remove redundant tests

The names of the tests were misleading: 'recursive' should have been
'nested', and the interesting topic in the 'cast' tests was not the cast
but the pointer dereference.
 1.5 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.4 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.3 21-Aug-2021  rillig tests/lint: guard against typos in test environment configuration

Some tests had "lint1-only-if" without a trailing colon, others included
the trailing colon. The tests that included the trailing colon were run
even though they were supposed to be skipped, and they failed, as could
be expected.

To prevent further typos, always require the trailing colon, just as in
"lint1-flags" and fail fast on unknown "lint1" comments.
 1.2 29-Jun-2021  rillig tests/lint: add test that only runs where char == unsigned char

There a 4 regular NetBSD builds where lint is activated. All these
builds run on platforms where char == signed char.

The official test runs from https://releng.netbsd.org/test-results.html
mostly have char == signed char as well.

However, lint behaves differently on platforms with char == unsigned
char. On these platforms, a simple "char ch = '\xff'" leads to the
bogus warning that "conversion of 'int' to 'char' is out of range".
 1.1 29-Jun-2021  rillig tests/lint: add tests for ILP32 platforms

Previously, all tests for lint had to produce the exact same output, no
matter which platform they ran on. This differs from practical needs
since lint is intended to produce different results depending on whether
the platform is ILP32 or LP64.

Examples for these are type conversions and the widths of the integer
types during lexical analysis.
 1.2 17-Jun-2022  rillig 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'.
 1.1 29-Jun-2021  rillig tests/lint: add tests for ILP32 platforms

Previously, all tests for lint had to produce the exact same output, no
matter which platform they ran on. This differs from practical needs
since lint is intended to produce different results depending on whether
the platform is ILP32 or LP64.

Examples for these are type conversions and the widths of the integer
types during lexical analysis.
 1.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 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 20-Nov-2021  rillig tests/lint: fix negation in explanation for strict bool mode
 1.3 23-Aug-2021  rillig tests/lint: add tests for integer comparisons
 1.2 19-Jun-2021  rillig lint: revert fix for endless loop in lexer for string literals

String literals may contain null bytes, and these must be passed further
on.

This reintroduces the endless loop in the lexer, but that must be fixed
in another way that doesn't destroy the error handling.
 1.1 19-Jun-2021  rillig tests/lint: add test cases for lexical analysis
 1.4 17-Jun-2022  rillig 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'.
 1.3 23-Aug-2021  rillig tests/lint: add tests for integer comparisons
 1.2 19-Jun-2021  rillig lint: revert fix for endless loop in lexer for string literals

String literals may contain null bytes, and these must be passed further
on.

This reintroduces the endless loop in the lexer, but that must be fixed
in another way that doesn't destroy the error handling.
 1.1 19-Jun-2021  rillig tests/lint: add test cases for lexical analysis
 1.3 03-Feb-2024  rillig lint: remove unused code for converting multibyte character sequences
 1.2 02-Feb-2024  rillig lint: use the locale for interpreting wide character strings
 1.1 02-Feb-2024  rillig tests/lint: test UTF-8 mode
 1.1 10-Sep-2021  rillig tests/lint: test line number tracking with \v and \f
 1.2 17-Jun-2022  rillig 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'.
 1.1 10-Sep-2021  rillig tests/lint: test line number tracking with \v and \f
 1.5 19-Jan-2024  rillig lint: allow '\e' only in GCC mode
 1.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 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.2 20-Jun-2021  rillig lint: fix check for empty wide character constant

This bug got almost 26 years old, it was already there at the initial
commit in 1995.
 1.1 19-Jun-2021  rillig tests/lint: add test cases for lexical analysis
 1.3 17-Jun-2022  rillig 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'.
 1.2 20-Jun-2021  rillig lint: fix check for empty wide character constant

This bug got almost 26 years old, it was already there at the initial
commit in 1995.
 1.1 19-Jun-2021  rillig tests/lint: add test cases for lexical analysis
 1.5 02-Feb-2024  rillig tests/lint: add UTF-8 test for string literals
 1.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 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.2 23-Aug-2021  rillig tests/lint: add tests for integer comparisons
 1.1 19-Jun-2021  rillig tests/lint: add test cases for lexical analysis
 1.3 17-Jun-2022  rillig 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'.
 1.2 23-Aug-2021  rillig tests/lint: add tests for integer comparisons
 1.1 19-Jun-2021  rillig tests/lint: add test cases for lexical analysis
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 02-Jan-2021  rillig lint: add a few more tests

No serious bugs found this time.
 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.5 17-Jun-2022  rillig 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'.
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.2 02-Jan-2021  rillig lint: add a few more tests

No serious bugs found this time.
 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.1 08-Jul-2021  rillig tests/lint: add tests for C90 mode and malformed declarations

In the grammar, 148 lines are still uncovered by the tests. The
untested parts are mostly obscure declarations and a few parse errors.
 1.2 17-Jun-2022  rillig 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'.
 1.1 08-Jul-2021  rillig tests/lint: add tests for C90 mode and malformed declarations

In the grammar, 148 lines are still uncovered by the tests. The
untested parts are mostly obscure declarations and a few parse errors.
 1.9 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.8 01-Oct-2022  rillig lint: add hyphen to adjective 'old-style'
 1.7 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.6 24-Apr-2022  rillig lint: error out on declarations with implicit int type
 1.5 24-Apr-2022  rillig tests/lint: demonstrate missing check for missing type
 1.4 31-Jan-2021  rillig lint: add quotes to messages 1 and 19
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 02-Jan-2021  rillig lint: add a few more tests

No serious bugs found this time.
 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.7 17-Jun-2022  rillig 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'.
 1.6 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.5 24-Apr-2022  rillig lint: error out on declarations with implicit int type
 1.4 24-Apr-2022  rillig tests/lint: demonstrate missing check for missing type
 1.3 31-Jan-2021  rillig lint: add quotes to messages 1 and 19
 1.2 02-Jan-2021  rillig lint: add a few more tests

No serious bugs found this time.
 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.3 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.2 01-Oct-2022  rillig lint: add hyphen to adjective 'old-style'
 1.1 08-Jul-2021  rillig tests/lint: add tests for C90 mode and malformed declarations

In the grammar, 148 lines are still uncovered by the tests. The
untested parts are mostly obscure declarations and a few parse errors.
 1.2 17-Jun-2022  rillig 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'.
 1.1 08-Jul-2021  rillig tests/lint: add tests for C90 mode and malformed declarations

In the grammar, 148 lines are still uncovered by the tests. The
untested parts are mostly obscure declarations and a few parse errors.
 1.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 14-Jul-2021  rillig tests/lint: add several tests for edge cases in the grammar
 1.4 08-Jul-2021  rillig tests/lint: add tests for C90 mode and malformed declarations

In the grammar, 148 lines are still uncovered by the tests. The
untested parts are mostly obscure declarations and a few parse errors.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 02-Jan-2021  rillig lint: add a few more tests

No serious bugs found this time.
 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.5 17-Jun-2022  rillig 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'.
 1.4 14-Jul-2021  rillig tests/lint: add several tests for edge cases in the grammar
 1.3 08-Jul-2021  rillig tests/lint: add tests for C90 mode and malformed declarations

In the grammar, 148 lines are still uncovered by the tests. The
untested parts are mostly obscure declarations and a few parse errors.
 1.2 02-Jan-2021  rillig lint: add a few more tests

No serious bugs found this time.
 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.9 03-Jan-2025  rillig lint: add detail to message about obsolete identifier list
 1.8 01-Dec-2024  rillig lint: warn about function definitions that still use identifier lists
 1.7 02-Aug-2023  rillig branches: 1.7.2;
lint: distinguish between arguments and parameters
 1.6 07-Jul-2023  rillig 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.5 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.4 28-Feb-2021  rillig tests/lint: keep messages in test files in sync with actual messages

Each of the tests named msg_*.c repeats the template of the message, to
make the test somewhat self-contained when viewed in isolation.

This creates a redundancy, and keeping track of this manually is next to
impossible. I tried it and failed in 9 cases, even though it has just
been 2 months since I myself created the initial files and I knew all
the time that this redundancy exists.

Be fool-proof for the future by checking this automatically.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 31-Jan-2021  rillig lint: add a few more tests
 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.7.2.1 02-Aug-2025  perseant Sync with HEAD
 1.6 17-Jun-2022  rillig 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'.
 1.5 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.4 09-Apr-2021  rillig lint: for structs and unions, include incompleteness in the type name

This mainly helps to assess the situation where lint warns that a
pointer cast "may be troublesome", see msg_247.exp.
 1.3 31-Jan-2021  rillig lint: be more precise in message 003 "tag in argument list"
 1.2 31-Jan-2021  rillig lint: add a few more tests
 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.10 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.9 30-Nov-2024  rillig tests/lint: add a few more tests to increase code coverage
 1.8 04-May-2024  rillig branches: 1.8.2;
lint: increase debug logging for declarations

All changes to the global variable 'dcs' are tracked now, to help
identify the cause of the failing tests in expr_sizeof and
gcc_attribute_aligned.

While here, test more invalid type combinations in typedefs.
 1.7 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.6 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.5 04-Jul-2021  rillig tests/lint: document why lint does not need to detect wrong types
 1.4 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 02-Jan-2021  rillig lint: add a few more tests

No serious bugs found this time.
 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.8.2.1 02-Aug-2025  perseant Sync with HEAD
 1.6 17-Jun-2022  rillig 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'.
 1.5 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.4 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.3 03-Jan-2021  rillig lint: fix spelling of message 308

All other messages are lowercase as well.
 1.2 02-Jan-2021  rillig lint: add a few more tests

No serious bugs found this time.
 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.7 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.6 04-May-2024  rillig branches: 1.6.2;
lint: increase debug logging for declarations

All changes to the global variable 'dcs' are tracked now, to help
identify the cause of the failing tests in expr_sizeof and
gcc_attribute_aligned.

While here, test more invalid type combinations in typedefs.
 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-Sep-2021  rillig lint: reduce indentation in tdeferr

No functional change.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 02-Jan-2021  rillig lint: add a few more tests

No serious bugs found this time.
 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.6.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 04-Sep-2021  rillig lint: reduce indentation in tdeferr

No functional change.
 1.2 02-Jan-2021  rillig lint: add a few more tests

No serious bugs found this time.
 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.7 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.6 28-Mar-2023  rillig branches: 1.6.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.4 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 07-Jan-2021  rillig lint: add tests for some messages
 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.6.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 07-Jan-2021  rillig lint: add tests for some messages
 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.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 01-Oct-2022  rillig lint: add hyphen to adjective 'old-style'
 1.4 24-Apr-2022  rillig lint: error out on missing type in declarations
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 07-Jan-2021  rillig lint: add tests for some messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 24-Apr-2022  rillig lint: error out on missing type in declarations
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 07-Jan-2021  rillig lint: add tests for some messages
 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.5 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.4 15-Jun-2022  rillig branches: 1.4.4;
tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 07-Jan-2021  rillig lint: add tests for some messages
 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.4.4.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 07-Jan-2021  rillig lint: add tests for some messages
 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.6 09-Jul-2023  rillig lint: clean up the wording of a few diagnostics
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 07-Jan-2021  rillig lint: add tests for some messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 07-Jan-2021  rillig lint: add tests for some messages
 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.7 13-Jul-2023  rillig lint: _Thread_local is a storage class, not a type qualifier
 1.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 30-Apr-2022  rillig lint: document why C11 keywords are available in C99 mode as well
 1.4 18-Jan-2021  rillig lint: fix assertion failure for restrict and _Thread_local
 1.3 18-Jan-2021  rillig lint: add more test cases for duplicate type qualifiers
 1.2 07-Jan-2021  rillig lint: add tests for some messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 30-Apr-2022  rillig lint: document why C11 keywords are available in C99 mode as well
 1.2 07-Jan-2021  rillig lint: add tests for some messages
 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.8 08-Jun-2024  rillig lint: add details to warnings about negative constant to unsigned
 1.7 07-Jul-2023  rillig 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 07-Jul-2023  rillig lint: only skip 'unused' warnings after errors, not other warnings

Previously, in -w mode, any warning suppressed further 'unused'
warnings, even though there was no need to do that. This can be seen in
the test gcc_attribute_var.c, where only the last unused variable from a
function was marked as unused, the others slipped through.

Fixed by counting the errors and the warnings separately and only
combining them if actually desired.
 1.5 26-Aug-2021  rillig tests/lint: add tests for several messages
 1.4 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.3 07-Jan-2021  rillig lint: revert test for message 11

That test only produced other messages, but not message 11.
 1.2 07-Jan-2021  rillig lint: add tests for some messages
 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.6 17-Jun-2022  rillig 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'.
 1.5 26-Aug-2021  rillig tests/lint: add tests for several messages
 1.4 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.3 07-Jan-2021  rillig lint: revert test for message 11

That test only produced other messages, but not message 11.
 1.2 07-Jan-2021  rillig lint: add tests for some messages
 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.5 07-Jul-2023  rillig 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.4 01-Apr-2022  rillig lint: add type details to message about 'sizeof(function)'

The code in add_function is severely broken, it mixes up the return type
of the function with the argument types. For now, at least show the
guessed type in the diagnostic, to allow human readers quickly spot the
bug.

Extend the test cases in decl_direct_abstract.c to show that the
behavior differs unreasonably if the first parameter of the function is
equal to its return type.
 1.3 26-Aug-2021  rillig tests/lint: add tests for several messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 01-Apr-2022  rillig lint: add type details to message about 'sizeof(function)'

The code in add_function is severely broken, it mixes up the return type
of the function with the argument types. For now, at least show the
guessed type in the diagnostic, to allow human readers quickly spot the
bug.

Extend the test cases in decl_direct_abstract.c to show that the
behavior differs unreasonably if the first parameter of the function is
equal to its return type.
 1.3 26-Aug-2021  rillig tests/lint: add tests for several messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 11-Jun-2022  rillig lint: add quotes around placeholders for a few more messages
 1.3 26-Aug-2021  rillig tests/lint: add tests for several messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 11-Jun-2022  rillig lint: add quotes around placeholders for a few more messages
 1.3 26-Aug-2021  rillig tests/lint: add tests for several messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.9 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.8 28-Mar-2023  rillig branches: 1.8.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.7 12-May-2022  rillig lint: fix support for __alignof__, add support for __alignof

Broken since lex.c 1.129 from yesterday.
 1.6 12-May-2022  rillig tests/lint: adjust tests to reflect missing support of __alignof__

The change in lex.c 1.129 attempted to add support for __alignof, in
addition to the existing support for __alignof__. It failed by removing
support for __alignof__, while allowing the plain 'alignof' instead.
 1.5 02-Apr-2022  rillig lint: remove unreachable message 'compiler takes alignment of function'
 1.4 01-Apr-2022  rillig lint: add type details to message about 'sizeof(function)'

The code in add_function is severely broken, it mixes up the return type
of the function with the argument types. For now, at least show the
guessed type in the diagnostic, to allow human readers quickly spot the
bug.

Extend the test cases in decl_direct_abstract.c to show that the
behavior differs unreasonably if the first parameter of the function is
equal to its return type.
 1.3 26-Aug-2021  rillig tests/lint: add tests for several messages
 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.8.2.1 02-Aug-2025  perseant Sync with HEAD
 1.8 17-Jun-2022  rillig 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'.
 1.7 12-May-2022  rillig lint: fix support for __alignof__, add support for __alignof

Broken since lex.c 1.129 from yesterday.
 1.6 12-May-2022  rillig tests/lint: adjust tests to reflect missing support of __alignof__

The change in lex.c 1.129 attempted to add support for __alignof, in
addition to the existing support for __alignof__. It failed by removing
support for __alignof__, while allowing the plain 'alignof' instead.
 1.5 02-Apr-2022  rillig lint: remove unreachable message 'compiler takes alignment of function'
 1.4 01-Apr-2022  rillig lint: add type details to message about 'sizeof(function)'

The code in add_function is severely broken, it mixes up the return type
of the function with the argument types. For now, at least show the
guessed type in the diagnostic, to allow human readers quickly spot the
bug.

Extend the test cases in decl_direct_abstract.c to show that the
behavior differs unreasonably if the first parameter of the function is
equal to its return type.
 1.3 26-Aug-2021  rillig tests/lint: add tests for several messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.5 28-Mar-2023  rillig branches: 1.5.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 01-Apr-2022  rillig lint: add details to message about illegal return type
 1.3 26-Aug-2021  rillig tests/lint: add tests for several messages
 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.5.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 01-Apr-2022  rillig lint: add details to message about illegal return type
 1.3 26-Aug-2021  rillig tests/lint: add tests for several messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.7 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.6 20-Feb-2025  rillig lint: mention the assignment operator in 'illegal combination'

In source lines that contain both a 'return' statement as well as a
function-like macro, such as the C11 atomics, seeing the word 'init' in
the diagnostic helps to see that the type conflict is not in the
'return' statement but instead in some initializer.

Seen in userspace-rcu/wfcqueue.h:147.
 1.5 28-Mar-2023  rillig branches: 1.5.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.3 26-Aug-2021  rillig tests/lint: add tests for several messages
 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.5.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 26-Aug-2021  rillig tests/lint: add tests for several messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.3 26-Aug-2021  rillig tests/lint: add tests for several messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 26-Aug-2021  rillig tests/lint: add tests for several messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.7 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.6 28-Mar-2023  rillig branches: 1.6.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.4 05-Apr-2022  rillig tests/lint: add tests for a few early messages
 1.3 26-Aug-2021  rillig tests/lint: add tests for several messages
 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.6.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 05-Apr-2022  rillig tests/lint: add tests for a few early messages
 1.3 26-Aug-2021  rillig tests/lint: add tests for several messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.9 28-Jan-2024  rillig tests/lint: enforce diagnostics to be listed in chronologic order

While here, fix the tests on uchar platforms.
 1.8 09-Jul-2023  rillig lint: clean up wording in diagnostics

Use the term 'parameter' as defined in C99 3.15.
 1.7 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.6 20-Jun-2022  rillig lint: add quotes around several placeholders in messages
 1.5 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.4 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.3 31-Jan-2021  rillig lint: add quotes to messages 1 and 19
 1.2 31-Jan-2021  rillig lint: test messages 019 and 021
 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.8 17-Jun-2022  rillig 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'.
 1.7 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.6 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.5 09-Apr-2021  rillig lint: quote placeholders in messages for unused variables
 1.4 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.3 31-Jan-2021  rillig lint: add quotes to messages 1 and 19
 1.2 31-Jan-2021  rillig lint: test messages 019 and 021
 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.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 27-Aug-2021  rillig tests/lint: add tests for a few more messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 27-Aug-2021  rillig tests/lint: add tests for a few more messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.8 03-Jan-2025  rillig lint: add detail to message about obsolete identifier list
 1.7 01-Dec-2024  rillig lint: warn about function definitions that still use identifier lists
 1.6 02-Aug-2023  rillig branches: 1.6.2;
lint: distinguish between arguments and parameters
 1.5 07-Jul-2023  rillig 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.4 20-Jun-2022  rillig lint: add quotes around several placeholders in messages
 1.3 11-Jun-2022  rillig lint: add quotes around placeholders for a few more messages
 1.2 31-Jan-2021  rillig lint: test messages 019 and 021
 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.6.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 11-Jun-2022  rillig lint: add quotes around placeholders for a few more messages
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 31-Jan-2021  rillig lint: test messages 019 and 021
 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.8 03-Jan-2025  rillig lint: add detail to message about obsolete identifier list
 1.7 01-Dec-2024  rillig lint: warn about function definitions that still use identifier lists
 1.6 28-Mar-2023  rillig branches: 1.6.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 01-Oct-2022  rillig lint: add hyphen to adjective 'old-style'
 1.4 05-Apr-2022  rillig tests/lint: add tests for a few early messages
 1.3 02-Apr-2022  rillig lint: try harder to recover after syntax errors

lint: assertion "false" failed in declarator_name at decl.c:1596
near msg_022.c:22
 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.6.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 05-Apr-2022  rillig tests/lint: add tests for a few early messages
 1.3 02-Apr-2022  rillig lint: try harder to recover after syntax errors

lint: assertion "false" failed in declarator_name at decl.c:1596
near msg_022.c:22
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 07-Jul-2023  rillig 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.4 11-Jul-2021  rillig lint: add quotes around placeholders in message 23 and 232
 1.3 11-Jul-2021  rillig lint: support __attribute__((hot))

The corresponding attribute 'cold' was already added in cgram.y 1.84
from 2016-12-29.
 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.5 17-Jun-2022  rillig 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'.
 1.4 11-Jul-2021  rillig lint: add quotes around placeholders in message 23 and 232
 1.3 11-Jul-2021  rillig lint: support __attribute__((hot))

The corresponding attribute 'cold' was already added in cgram.y 1.84
from 2016-12-29.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 21-Jul-2023  rillig lint: reword message about non-constant initializer
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 19-Jun-2022  rillig tests/lint: add quotes around placeholders in a few messages
 1.3 27-Aug-2021  rillig tests/lint: add tests for a few more messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 27-Aug-2021  rillig tests/lint: add tests for a few more messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 19-Jun-2022  rillig tests/lint: add quotes around placeholders in a few messages
 1.3 27-Aug-2021  rillig tests/lint: add tests for a few more messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 27-Aug-2021  rillig tests/lint: add tests for a few more messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 19-Jun-2022  rillig tests/lint: add quotes around placeholders in a few messages
 1.3 05-Apr-2022  rillig tests/lint: add tests for a few early messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 05-Apr-2022  rillig tests/lint: add tests for a few early messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.8 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.7 11-Jun-2022  rillig lint: add quotes around placeholders for a few more messages
 1.6 05-Apr-2022  rillig tests/lint: add tests for a few early messages
 1.5 12-Sep-2021  rillig lint: add more details to error about redeclaration

Message 27 is triggered by several conditions. The one triggered by
register_vget in sbin/fsck_lfs/vnode.c needs more details than the
others.
 1.4 12-Sep-2021  rillig tests/lint: demonstrate parse error for function-type parameters

Seen in sbin/fsck_lfs/vnode.c(104), where lint wrongly complains:

error: redeclaration of register_vget [27]
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 03-Jan-2021  rillig lint: add tests for some of the messages
 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.8 17-Jun-2022  rillig 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'.
 1.7 11-Jun-2022  rillig lint: add quotes around placeholders for a few more messages
 1.6 05-Apr-2022  rillig tests/lint: add tests for a few early messages
 1.5 12-Sep-2021  rillig lint: add more details to error about redeclaration

Message 27 is triggered by several conditions. The one triggered by
register_vget in sbin/fsck_lfs/vnode.c needs more details than the
others.
 1.4 12-Sep-2021  rillig tests/lint: demonstrate parse error for function-type parameters

Seen in sbin/fsck_lfs/vnode.c(104), where lint wrongly complains:

error: redeclaration of register_vget [27]
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 03-Jan-2021  rillig lint: add tests for some of the messages
 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.5 07-Jul-2023  rillig 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.4 19-Jun-2022  rillig tests/lint: add quotes around placeholders in a few messages
 1.3 05-Apr-2022  rillig tests/lint: add tests for a few early messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 05-Apr-2022  rillig tests/lint: add tests for a few early messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 19-Jun-2022  rillig tests/lint: add quotes around placeholders in a few messages
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 03-Jan-2021  rillig lint: add tests for some of the messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.2 03-Jan-2021  rillig lint: add tests for some of the messages
 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.8 26-Aug-2023  rillig lint: make diagnostics about ANSI C more international
 1.7 07-Jul-2023  rillig 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 01-Oct-2022  rillig lint: add hyphen to adjective 'old-style'
 1.5 11-Jun-2022  rillig lint: add quotes around placeholders for a few more messages
 1.4 24-Apr-2022  rillig lint: error out on missing type in declarations
 1.3 05-Apr-2022  rillig tests/lint: add tests for a few early messages
 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.6 17-Jun-2022  rillig 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'.
 1.5 11-Jun-2022  rillig lint: add quotes around placeholders for a few more messages
 1.4 24-Apr-2022  rillig lint: error out on missing type in declarations
 1.3 05-Apr-2022  rillig tests/lint: add tests for a few early messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.9 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.8 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.7 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.6 13-Jul-2021  rillig lint: fix wording of message for incomplete struct (2021-07-04)

A struct member is not an argument. In err.c 1.124 from 2021-07-04, the
wording had been changed, without noticing that the message was used
twice: once for an argument, once for a struct member.
 1.5 04-Jul-2021  rillig lint: improve wording for incomplete struct or union
 1.4 16-Mar-2021  rillig tests/lint: add tests for a few more messages
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 03-Jan-2021  rillig lint: add tests for some of the messages
 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.9 17-Jun-2022  rillig 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'.
 1.8 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.7 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.6 13-Jul-2021  rillig lint: fix wording of message for incomplete struct (2021-07-04)

A struct member is not an argument. In err.c 1.124 from 2021-07-04, the
wording had been changed, without noticing that the message was used
twice: once for an argument, once for a struct member.
 1.5 04-Jul-2021  rillig lint: improve wording for incomplete struct or union
 1.4 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.3 16-Mar-2021  rillig tests/lint: add tests for a few more messages
 1.2 03-Jan-2021  rillig lint: add tests for some of the messages
 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.10 03-Jan-2025  rillig lint: add detail to message about obsolete identifier list
 1.9 01-Dec-2024  rillig lint: warn about function definitions that still use identifier lists
 1.8 02-Aug-2023  rillig branches: 1.8.2;
lint: distinguish between arguments and parameters
 1.7 07-Jul-2023  rillig 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 01-Oct-2022  rillig lint: add hyphen to adjective 'old-style'
 1.5 20-Jun-2022  rillig lint: add quotes around several placeholders in messages
 1.4 24-Apr-2022  rillig lint: error out on declarations with implicit int type
 1.3 05-Apr-2022  rillig tests/lint: add tests for a few early messages
 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.8.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 24-Apr-2022  rillig lint: error out on declarations with implicit int type
 1.3 05-Apr-2022  rillig tests/lint: add tests for a few early messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 19-Jun-2022  rillig lint: add quotes around placeholders in 4 messages
 1.3 27-Aug-2021  rillig tests/lint: add tests for a few more messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 27-Aug-2021  rillig tests/lint: add tests for a few more messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 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.5 16-May-2021  rillig lint: add more specific warning for bit-field of type plain 'int'

Previously, declaring a bit-field of type plain 'int' resulted in this
warning:

warning: nonportable bit-field type 'int' [34]

This warning was too unspecific to be actionable, and until yesterday it
didn't even include the type. In order to allow this warning to be
understood and properly fixed, describe the actual nonportability more
precisely:

warning: bit-field of type plain 'int' has
implementation-defined signedness [344]
 1.4 16-May-2021  rillig lint: add type information to unportable bit-field type

Seeing the message "unportable bit-field type 'int'" may sound strange
at first, but that's a strict interpretation of the wording in C99
6.7.2.1p4, which requires that the bit-field type is "'_Bool', 'unsigned
int' or 'signed int', or some other implementation-defined type".

The rationale for C99 6.7.2.1 explicitly lists plain 'int' among the
allowed types for bit-fields, regardless of any additional
implementation-defined types. This means that lint had interpreted this
paragraph wrong, and it should be fixed to allow plain int as well.
 1.3 31-Jan-2021  rillig branches: 1.3.2;
lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 03-Jan-2021  rillig lint: add tests for some of the messages
 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.3.2.1 31-May-2021  cjep sync with head
 1.5 17-Jun-2022  rillig 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'.
 1.4 16-May-2021  rillig lint: add more specific warning for bit-field of type plain 'int'

Previously, declaring a bit-field of type plain 'int' resulted in this
warning:

warning: nonportable bit-field type 'int' [34]

This warning was too unspecific to be actionable, and until yesterday it
didn't even include the type. In order to allow this warning to be
understood and properly fixed, describe the actual nonportability more
precisely:

warning: bit-field of type plain 'int' has
implementation-defined signedness [344]
 1.3 16-May-2021  rillig lint: add type information to unportable bit-field type

Seeing the message "unportable bit-field type 'int'" may sound strange
at first, but that's a strict interpretation of the wording in C99
6.7.2.1p4, which requires that the bit-field type is "'_Bool', 'unsigned
int' or 'signed int', or some other implementation-defined type".

The rationale for C99 6.7.2.1 explicitly lists plain 'int' among the
allowed types for bit-fields, regardless of any additional
implementation-defined types. This means that lint had interpreted this
paragraph wrong, and it should be fixed to allow plain int as well.
 1.2 03-Jan-2021  rillig branches: 1.2.2;
lint: add tests for some of the messages
 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.2.2.1 31-May-2021  cjep sync with head
 1.12 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.11 15-Jun-2022  rillig branches: 1.11.4;
tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.10 22-Dec-2021  rillig lint: use C90 instead of C89 when referring to the C standard
 1.9 02-May-2021  rillig tests/lint: add test for bit-field types in GCC mode
 1.8 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.7 28-Feb-2021  rillig lint: add type information to 'illegal bit-field type'
 1.6 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.5 02-Jan-2021  rillig lint: fix message 308 "Invalid type for _Complex"

Previously, lint aborted since it didn't expect tspec_name to be called
with NOTSPEC, which at that point was the only possible value of
dcs->d_cmod.
 1.4 02-Jan-2021  rillig lint: allow _Bool for bit-fields
 1.3 02-Jan-2021  rillig lint: fix and document test for illegal bit-fields

The _Complex bit-field should have been commented out.
 1.2 02-Jan-2021  rillig lint: add test for message 35: illegal bit-field type

Bug: _Bool is not accepted as a bit-field, but it should be.

Bug: lint aborts in a controlled manner with message "common/tyname.c,
190: tspec_name(0)" when it sees a declaration of a _Complex bit-field.
(Not that a _Complex bit-field would make any sense.)
 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.11.4.1 02-Aug-2025  perseant Sync with HEAD
 1.13 17-Jun-2022  rillig 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'.
 1.12 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.11 02-May-2021  rillig tests/lint: add test for bit-field types in GCC mode
 1.10 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.9 07-Mar-2021  rillig lint: in the name of an array type, list the dimension first

before: array of unsigned int[4]
now: array[4] of unsigned int

Listing the array dimension first keeps it in contact with the keyword
'array'. This reduces confusion, especially for nested arrays.
 1.8 28-Feb-2021  rillig lint: add type information to 'illegal bit-field type'
 1.7 31-Jan-2021  rillig lint: add quotes to messages 1 and 19
 1.6 03-Jan-2021  rillig lint: fix spelling of message 308

All other messages are lowercase as well.
 1.5 02-Jan-2021  rillig lint: fix message 308 "Invalid type for _Complex"

Previously, lint aborted since it didn't expect tspec_name to be called
with NOTSPEC, which at that point was the only possible value of
dcs->d_cmod.
 1.4 02-Jan-2021  rillig lint: allow _Bool for bit-fields
 1.3 02-Jan-2021  rillig lint: fix and document test for illegal bit-fields

The _Complex bit-field should have been commented out.
 1.2 02-Jan-2021  rillig lint: add test for message 35: illegal bit-field type

Bug: _Bool is not accepted as a bit-field, but it should be.

Bug: lint aborts in a controlled manner with message "common/tyname.c,
190: tspec_name(0)" when it sees a declaration of a _Complex bit-field.
(Not that a _Complex bit-field would make any sense.)
 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.5 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.4 15-Jun-2022  rillig branches: 1.4.4;
tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 03-Jan-2021  rillig lint: add tests for some of the messages
 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.4.4.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 03-Jan-2021  rillig lint: add tests for some of the messages
 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.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 03-Jan-2021  rillig lint: add tests for some of the messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 03-Jan-2021  rillig lint: add tests for some of the messages
 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.5 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.4 28-Mar-2023  rillig branches: 1.4.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 27-Aug-2021  rillig tests/lint: add tests for a few more messages
 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.4.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 27-Aug-2021  rillig tests/lint: add tests for a few more messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 14-Sep-2023  rillig lint: fix wording of diagnostics about 'C99 extension'

The term 'extension' means an extension to a C standard. C99 by itself
is not an extension but a revision of the C standard.
 1.4 20-Jun-2022  rillig lint: add quotes around several placeholders in messages
 1.3 05-Apr-2022  rillig tests/lint: add tests for a few early messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 05-Apr-2022  rillig tests/lint: add tests for a few early messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 05-Apr-2022  rillig tests/lint: add tests for a few early messages
 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.3 05-Apr-2022  rillig tests/lint: add tests for a few early messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.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 07-Feb-2022  rillig lint: reword message about bit-field in a union

There is nothing illegal about a bit-field in a union, it is allowed by
C90, C99 and C11.

Fixes PR toolchain/53219.
 1.3 07-Feb-2022  rillig tests/lint: add test for message 41 about bit-field in union

See PR toolchain/53219.
 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.5 17-Jun-2022  rillig 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'.
 1.4 07-Feb-2022  rillig lint: reword message about bit-field in a union

There is nothing illegal about a bit-field in a union, it is allowed by
C90, C99 and C11.

Fixes PR toolchain/53219.
 1.3 07-Feb-2022  rillig tests/lint: add test for message 41 about bit-field in union

See PR toolchain/53219.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.3 08-Apr-2022  rillig lint: remove unused message 70, add some more tests
 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.4 17-Jun-2022  rillig 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'.
 1.3 08-Apr-2022  rillig lint: remove unused message 70, add some more tests
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 07-Jul-2023  rillig 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.4 20-Jun-2022  rillig lint: add quotes around several placeholders in messages
 1.3 08-Apr-2022  rillig lint: remove unused message 70, add some more tests
 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.4 17-Jun-2022  rillig 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'.
 1.3 08-Apr-2022  rillig lint: remove unused message 70, add some more tests
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.7 26-Aug-2023  rillig lint: make diagnostics about ANSI C more international
 1.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 20-Jun-2022  rillig lint: add quotes around several placeholders in messages
 1.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 26-Aug-2021  rillig tests/lint: add tests for several messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 26-Aug-2021  rillig tests/lint: add tests for several messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.8 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.7 26-Aug-2023  rillig branches: 1.7.2;
lint: make diagnostics about ANSI C more international
 1.6 20-Jun-2022  rillig lint: add quotes around several placeholders in messages
 1.5 19-Jun-2022  rillig lint: add quotes around placeholders in 4 messages
 1.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 08-Apr-2022  rillig lint: remove unused message 70, add some more tests
 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.7.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 08-Apr-2022  rillig lint: remove unused message 70, add some more tests
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.4 16-Aug-2021  rillig lint: add more details to message about redeclared tag
 1.3 16-Aug-2021  rillig tests/lint: test message for redeclared tags
 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.6 17-Jun-2022  rillig 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'.
 1.5 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.4 16-Aug-2021  rillig lint: add more details to message about redeclared tag
 1.3 16-Aug-2021  rillig tests/lint: test message for redeclared tags
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 14-Sep-2023  rillig lint: fix wording of diagnostics about 'C99 extension'

The term 'extension' means an extension to a C standard. C99 by itself
is not an extension but a revision of the C standard.
 1.5 20-Jun-2022  rillig lint: add quotes around several placeholders in messages
 1.4 27-Feb-2022  rillig tests/lint: add tests for messages referring to C99
 1.3 27-Feb-2022  rillig lint: C99 has been released, so refer to it by its proper name
 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.4 17-Jun-2022  rillig 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'.
 1.3 27-Feb-2022  rillig tests/lint: add tests for messages referring to C99
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 20-Jun-2022  rillig lint: add quotes around several placeholders in messages
 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 08-Apr-2022  rillig lint: fix undefined behavior on enum overflow (since 1995)

GCC had optimized the check away, due to the obvious integer overflow 'x
- 1 == INT_MAX'. To prevent further bugs like this, compile with
-ftrapv.
 1.3 08-Apr-2022  rillig lint: remove unused message 70, add some more tests
 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.5 17-Jun-2022  rillig 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'.
 1.4 08-Apr-2022  rillig lint: fix undefined behavior on enum overflow (since 1995)

GCC had optimized the check away, due to the obvious integer overflow 'x
- 1 == INT_MAX'. To prevent further bugs like this, compile with
-ftrapv.
 1.3 08-Apr-2022  rillig lint: remove unused message 70, add some more tests
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 24-Apr-2022  rillig lint: warn about anonymous struct in struct, in plain C99 mode
 1.4 27-Feb-2022  rillig lint: C99 has been released, so refer to it by its proper name
 1.3 27-Aug-2021  rillig tests/lint: add tests for a few more messages
 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.6 17-Jun-2022  rillig 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'.
 1.5 24-Apr-2022  rillig lint: warn about anonymous struct in struct, in plain C99 mode
 1.4 27-Feb-2022  rillig lint: C99 has been released, so refer to it by its proper name
 1.3 27-Aug-2021  rillig tests/lint: add tests for a few more messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.7 09-Jul-2023  rillig lint: clean up wording in diagnostics

Use the term 'parameter' as defined in C99 3.15.
 1.6 07-Jul-2023  rillig 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.5 20-Jun-2022  rillig lint: add quotes around several placeholders in messages
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.6 17-Jun-2022  rillig 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'.
 1.5 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.4 09-Apr-2021  rillig lint: quote placeholders in messages for unused variables
 1.3 28-Mar-2021  rillig lint: only define GCC builtins if -g is given

This removes 7 wrong warnings when running lint in -t mode.

Surprisingly, this added a warning that had not been there before in
msg_189.c. This is because check_variable_usage skips the checks when
an error occurred before. All diagnostics that happened were warnings,
but the -w option treats them as errors, see vwarning.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.9 03-Jan-2025  rillig lint: add detail to message about obsolete identifier list
 1.8 01-Dec-2024  rillig lint: warn about function definitions that still use identifier lists
 1.7 09-Jul-2023  rillig branches: 1.7.2;
lint: clean up wording in diagnostics

Use the term 'parameter' as defined in C99 3.15.
 1.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.4 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.7.2.1 02-Aug-2025  perseant Sync with HEAD
 1.6 17-Jun-2022  rillig 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'.
 1.5 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.4 09-Apr-2021  rillig lint: quote placeholders in messages for unused variables
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.7 03-Jan-2025  rillig lint: add detail to message about obsolete identifier list
 1.6 01-Dec-2024  rillig lint: warn about function definitions that still use identifier lists
 1.5 07-Jul-2023  rillig branches: 1.5.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.4 20-Jun-2022  rillig lint: add quotes around several placeholders in messages
 1.3 27-Aug-2021  rillig tests/lint: add tests for a few more messages
 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.5.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 27-Aug-2021  rillig tests/lint: add tests for a few more messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.10 03-Jan-2025  rillig lint: add detail to message about obsolete identifier list
 1.9 01-Dec-2024  rillig lint: warn about function definitions that still use identifier lists
 1.8 02-Aug-2023  rillig branches: 1.8.2;
lint: distinguish between arguments and parameters
 1.7 07-Jul-2023  rillig 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 01-Oct-2022  rillig lint: add hyphen to adjective 'old-style'
 1.5 20-Jun-2022  rillig lint: add quotes around several placeholders in messages
 1.4 24-Apr-2022  rillig lint: error out on declarations with implicit int type
 1.3 27-Aug-2021  rillig tests/lint: add tests for a few more messages
 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.8.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 24-Apr-2022  rillig lint: error out on declarations with implicit int type
 1.3 27-Aug-2021  rillig tests/lint: add tests for a few more messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 11-Jul-2023  rillig lint: update wording in diagnostic for C99
 1.4 16-Apr-2022  rillig lint: in C99 mode, allow trailing comma in enum declarations

Adjust the test to be run in C90 mode instead of traditional mode, since
traditional C didn't have enums.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 16-Apr-2022  rillig lint: in C99 mode, allow trailing comma in enum declarations

Adjust the test to be run in C90 mode instead of traditional mode, since
traditional C didn't have enums.
 1.3 28-Mar-2021  rillig lint: only define GCC builtins if -g is given

This removes 7 wrong warnings when running lint in -t mode.

Surprisingly, this added a warning that had not been there before in
msg_189.c. This is because check_variable_usage skips the checks when
an error occurred before. All diagnostics that happened were warnings,
but the -w option treats them as errors, see vwarning.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.7 20-Nov-2024  rillig tests/lint: clean up
 1.6 30-Oct-2024  rillig tests/lint: fix test for 'constant too large' on ILP32 platforms
 1.5 29-Oct-2024  rillig lint: add details to message about too large integer constant
 1.4 15-Jun-2022  rillig branches: 1.4.4;
tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.4.4.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.8 09-Jul-2023  rillig lint: clean up wording in diagnostics

Use the term 'parameter' as defined in C99 3.15.
 1.7 07-Jul-2023  rillig 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 20-Jun-2022  rillig lint: add quotes around several placeholders in messages
 1.5 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.4 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 09-Apr-2021  rillig lint: quote placeholders in messages for unused variables
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.7 03-Jan-2025  rillig lint: add detail to message about obsolete identifier list
 1.6 01-Dec-2024  rillig lint: warn about function definitions that still use identifier lists
 1.5 28-Mar-2023  rillig branches: 1.5.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 20-Jun-2022  rillig lint: add quotes around several placeholders in messages
 1.3 27-Feb-2022  rillig tests/lint: add tests for messages about old-style functions
 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.5.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 27-Feb-2022  rillig tests/lint: add tests for messages about old-style functions
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 07-Jul-2023  rillig 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.4 20-Jun-2022  rillig lint: add quotes around several placeholders in messages
 1.3 27-Feb-2022  rillig tests/lint: add tests for messages about old-style functions
 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.4 17-Jun-2022  rillig 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'.
 1.3 27-Feb-2022  rillig tests/lint: add tests for messages about old-style functions
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.4 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 20-Jun-2022  rillig lint: add quotes around several placeholders in messages
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.9 03-Jan-2025  rillig lint: add detail to message about obsolete identifier list
 1.8 01-Dec-2024  rillig lint: warn about function definitions that still use identifier lists
 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 01-Oct-2022  rillig lint: add hyphen to adjective 'old-style'
 1.5 21-Jun-2022  rillig lint: add quotes and details to some more messages
 1.4 24-Apr-2022  rillig lint: error out on declarations with implicit int type
 1.3 27-Feb-2022  rillig tests/lint: add tests for messages about old-style functions
 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.7.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 24-Apr-2022  rillig lint: error out on declarations with implicit int type
 1.3 27-Feb-2022  rillig tests/lint: add tests for messages about old-style functions
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 03-Jan-2025  rillig lint: add detail to message about obsolete identifier list
 1.5 01-Dec-2024  rillig lint: warn about function definitions that still use identifier lists
 1.4 07-Jul-2023  rillig branches: 1.4.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.3 27-Feb-2022  rillig tests/lint: add tests for messages about old-style functions
 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.4.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 27-Feb-2022  rillig tests/lint: add tests for messages about old-style functions
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 02-Aug-2023  rillig lint: distinguish between arguments and parameters
 1.3 12-Jul-2021  rillig tests/lint: test trying to define a ()-less function
 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.4 17-Jun-2022  rillig 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'.
 1.3 12-Jul-2021  rillig tests/lint: test trying to define a ()-less function
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 30-Jun-2023  rillig lint: fix computation of bit-field width

When bit-fields in packed structs were added on 2009-10-02, lint assumed
that they would only use 'signed int' or 'unsigned int' as storage unit,
even though C99 also allows _Bool.

The cleanup commit for decl.c 1.225 from 2021-08-28 accidentally changed
the rounding mode for bit-field storage units from round-up to
round-down.
 1.4 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.3 13-Jul-2021  rillig tests/lint: add tests for empty and incomplete structs
 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.4 17-Jun-2022  rillig 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'.
 1.3 13-Jul-2021  rillig tests/lint: add tests for empty and incomplete structs
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 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.5 26-Aug-2021  rillig tests/lint: add tests for several messages
 1.4 15-Jul-2021  rillig lint: remove message 66 about missing semicolon in struct-declaration
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 26-Aug-2021  rillig tests/lint: add tests for several messages
 1.3 15-Jul-2021  rillig lint: remove message 66 about missing semicolon in struct-declaration
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.4 13-Jul-2021  rillig lint: fix wording of message for incomplete struct (2021-07-04)

A struct member is not an argument. In err.c 1.124 from 2021-07-04, the
wording had been changed, without noticing that the message was used
twice: once for an argument, once for a struct member.
 1.3 13-Jul-2021  rillig tests/lint: add tests for empty and incomplete structs
 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.6 17-Jun-2022  rillig 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'.
 1.5 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.4 13-Jul-2021  rillig lint: fix wording of message for incomplete struct (2021-07-04)

A struct member is not an argument. In err.c 1.124 from 2021-07-04, the
wording had been changed, without noticing that the message was used
twice: once for an argument, once for a struct member.
 1.3 13-Jul-2021  rillig tests/lint: add tests for empty and incomplete structs
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 30-Nov-2024  rillig tests/lint: add a few more tests to increase code coverage
 1.5 28-Mar-2023  rillig branches: 1.5.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.5.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 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.3 08-Apr-2022  rillig lint: remove unused message 70, add some more tests
 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.4 17-Jun-2022  rillig 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'.
 1.3 08-Apr-2022  rillig lint: remove unused message 70, add some more tests
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 26-Aug-2023  rillig lint: make diagnostics about ANSI C more international
 1.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 08-Apr-2022  rillig lint: remove unused message 70, add some more tests
 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.3 08-Apr-2022  rillig lint: remove unused message 70, add some more tests
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.7 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.6 22-Jan-2023  rillig lint: prevent undefined behavior for signed '<<'

Found by manual code inspection, verified by MKSANITIZER=yes
USE_SANITIZER=undefined.
 1.5 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.4 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 03-Jan-2021  rillig lint: add tests for some of the messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 03-Jan-2021  rillig lint: add tests for some of the messages
 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.8 07-Jul-2023  rillig 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.7 01-Oct-2022  rillig lint: add hyphen to adjective 'old-style'
 1.6 24-Apr-2022  rillig lint: error out on missing type in declarations
 1.5 14-Jul-2021  rillig tests/lint: add several tests for edge cases in the grammar
 1.4 08-Jul-2021  rillig tests/lint: add tests for C90 mode and malformed declarations

In the grammar, 148 lines are still uncovered by the tests. The
untested parts are mostly obscure declarations and a few parse errors.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 03-Jan-2021  rillig lint: add tests for some of the messages
 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.6 17-Jun-2022  rillig 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'.
 1.5 24-Apr-2022  rillig lint: error out on missing type in declarations
 1.4 14-Jul-2021  rillig tests/lint: add several tests for edge cases in the grammar
 1.3 08-Jul-2021  rillig tests/lint: add tests for C90 mode and malformed declarations

In the grammar, 148 lines are still uncovered by the tests. The
untested parts are mostly obscure declarations and a few parse errors.
 1.2 03-Jan-2021  rillig lint: add tests for some of the messages
 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.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 03-Jan-2021  rillig lint: add tests for some of the messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 03-Jan-2021  rillig lint: add tests for some of the messages
 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.8 03-Feb-2024  rillig tests/lint: extend tests for hexadecimal character escapes
 1.7 02-Feb-2024  rillig tests/lint: test lexing of characters and strings
 1.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.4 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 03-Jan-2021  rillig lint: add tests for some of the messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 03-Jan-2021  rillig lint: add tests for some of the messages
 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.10 03-Feb-2024  rillig tests/lint: extend tests for hexadecimal character escapes
 1.9 03-Feb-2024  rillig lint: allow hexadecimal character escapes up to UINT_MAX

Previously, any value larger than INT_MAX was regarded as negative and
thus terminated the loop around get_escaped_char.
 1.8 03-Feb-2024  rillig lint: allow larger numbers in escapes for wide characters and strings
 1.7 02-Feb-2024  rillig tests/lint: test lexing of characters and strings
 1.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 22-Jan-2023  rillig lint: prevent undefined behavior for signed '<<'

Found by manual code inspection, verified by MKSANITIZER=yes
USE_SANITIZER=undefined.
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.8 03-Feb-2024  rillig lint: allow larger numbers in escapes for wide characters and strings
 1.7 03-Feb-2024  rillig tests/lint: test octal escapes in character and wide strings
 1.6 02-Feb-2024  rillig tests/lint: test lexing of characters and strings
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 29-Jun-2021  rillig tests/lint: add tests for the lexical analysis
 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.5 17-Jun-2022  rillig 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'.
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 29-Jun-2021  rillig tests/lint: add tests for the lexical analysis
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.9 03-Feb-2024  rillig lint: warn about short octal escape followed by '8' or '9'

These mistakes is typically found in snprintb format directives but is
probably a typo everywhere else as well.
 1.8 09-Jul-2023  rillig lint: clean up the wording of a few diagnostics
 1.7 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.6 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.5 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.4 29-Jun-2021  rillig lint: fix lexical analysis of character constants in traditional C

The code now follows the wording of the C Reference Manual from 1978.
 1.3 29-Jun-2021  rillig tests/lint: add tests for the lexical analysis
 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.6 17-Jun-2022  rillig 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'.
 1.5 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.4 29-Jun-2021  rillig lint: fix lexical analysis of character constants in traditional C

The code now follows the wording of the C Reference Manual from 1978.
 1.3 29-Jun-2021  rillig tests/lint: add tests for the lexical analysis
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 27-Aug-2021  rillig lint: remove unused message about nonportable character escape

It has not been used since at least 2001.
 1.3 27-Aug-2021  rillig tests/lint: add tests for a few more messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 27-Aug-2021  rillig lint: remove unused message about nonportable character escape

It has not been used since at least 2001.
 1.3 27-Aug-2021  rillig tests/lint: add tests for a few more messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 02-Feb-2024  rillig tests/lint: test lexing of characters and strings
 1.5 19-Jan-2024  rillig lint: allow '\e' only in GCC mode
 1.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 27-Aug-2021  rillig tests/lint: add tests for a few more messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 27-Aug-2021  rillig tests/lint: add tests for a few more messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.1 02-Feb-2024  rillig tests/lint: test lexing of characters and strings
 1.7 02-Feb-2024  rillig tests/lint: test lexing of characters and strings
 1.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 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 tests/lint: fix unintended character constant in test

I originally intended to type ASCII DEL as an example of a nonprintable
character code. The actual character that landed in the code was
instead U+2303 "house", which looks similar to the typical
representation of the DEL character. The UTF-8 byte sequence for that
code point started with \xE2, or in octal \342.
 1.3 29-Jun-2021  rillig tests/lint: add tests for the lexical analysis
 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.5 17-Jun-2022  rillig 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'.
 1.4 04-Jul-2021  rillig tests/lint: fix unintended character constant in test

I originally intended to type ASCII DEL as an example of a nonprintable
character code. The actual character that landed in the code was
instead U+2303 "house", which looks similar to the typical
representation of the DEL character. The UTF-8 byte sequence for that
code point started with \xE2, or in octal \342.
 1.3 29-Jun-2021  rillig tests/lint: add tests for the lexical analysis
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.8 12-Apr-2025  rillig lint: reword messages that apply to traditional C
 1.7 02-Feb-2024  rillig branches: 1.7.2;
tests/lint: test lexing of characters and strings
 1.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.4 16-Apr-2022  rillig lint: model C language levels in a future-compatible way

The options -t, -s and -S are confusing because they are used
inconsistently. The option -S enables C99 features, but when using it
instead of -s, it also doesn't enable all checks required by C90 and
later. Prepare fixing of these inconsistencies by replacing the flag
variables with language levels that can be extended in a
straight-forward way as new C standards arrive.

| option | allow_trad | allow_c90 | allow_c99 | allow_c11 |
|--------|------------|-----------|-----------|-----------|
| -t | x | - | - | - |
| (none) | x | x | - | - |
| -s | - | x | - | - |
| -S | - | x | x | - |
| -Ac11 | - | x | x | x |

Each usage of the old flag variables will be inspected and migrated
individually, to clean up the subtle variations in the conditions and to
provide a simpler model.

When lint was created in 1995, its focus was migrating traditional C
code to C90 code. Lint does not help in migrating from C90 to C99 or
from C99 to C11 since there are only few silent changes, and simply
because nobody took the time to implement these migration aids. If
necessary, such migration modes could be added separately.

There is a small functional change: when the option -s is combined with
either -S or -Ac11, lint now only keeps the last of these options.
Previously, these options could be combined, leading to a mixture of
language levels, halfway between C90, C99 and C11. Especially combining
traditional C with C11 doesn't make sense, but xlint currently allows
it.

The 3 tests that accidentally specified multiple language levels have
been adjusted to a single language level.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.7.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 28-Mar-2021  rillig lint: only define GCC builtins if -g is given

This removes 7 wrong warnings when running lint in -t mode.

Surprisingly, this added a warning that had not been there before in
msg_189.c. This is because check_variable_usage skips the checks when
an error occurred before. All diagnostics that happened were warnings,
but the -w option treats them as errors, see vwarning.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.8 12-Apr-2025  rillig lint: reword messages that apply to traditional C
 1.7 02-Feb-2024  rillig branches: 1.7.2;
tests/lint: test lexing of characters and strings
 1.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.4 29-Jun-2021  rillig tests/lint: add tests for the lexical analysis
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.7.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 28-Mar-2021  rillig lint: only define GCC builtins if -g is given

This removes 7 wrong warnings when running lint in -t mode.

Surprisingly, this added a warning that had not been there before in
msg_189.c. This is because check_variable_usage skips the checks when
an error occurred before. All diagnostics that happened were warnings,
but the -w option treats them as errors, see vwarning.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.8 28-Jan-2024  rillig tests/lint: sort multiple diagnostics per line chronologically

For now, the chronologic order is not enforced but has to be established
manually, for example by removing all 'expect' comment lines and
regenerating them with 'accept.sh -u'.

While here, clean up a few instances that came up when regenerating the
'expect' comments, such as wrong indentation or needless deviation from
the 'expect+1' form.
 1.7 07-Jul-2023  rillig lint: only skip 'unused' warnings after errors, not other warnings

Previously, in -w mode, any warning suppressed further 'unused'
warnings, even though there was no need to do that. This can be seen in
the test gcc_attribute_var.c, where only the last unused variable from a
function was marked as unused, the others slipped through.

Fixed by counting the errors and the warnings separately and only
combining them if actually desired.
 1.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.4 10-Jul-2021  rillig tests/lint: add another example for storage class in declaration
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 10-Jul-2021  rillig tests/lint: add another example for storage class in declaration
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.6 26-Aug-2023  rillig lint: make diagnostics about ANSI C more international
 1.5 07-Jul-2023  rillig 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.4 16-Apr-2022  rillig tests/lint: refine test for varargs function
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 16-Apr-2022  rillig tests/lint: refine test for varargs function
 1.3 09-Apr-2021  rillig lint: quote placeholders in messages for unused variables
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.8 02-Aug-2023  rillig lint: distinguish between arguments and parameters
 1.7 30-Jun-2023  rillig lint: clean up handling of declarations

No functional change.
 1.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 21-Jun-2022  rillig lint: add quotes and details to some more messages
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 31-Jan-2021  rillig lint: add a few more tests
 1.2 02-Jan-2021  rillig lint: add a few more tests

No serious bugs found this time.
 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.6 17-Jun-2022  rillig 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'.
 1.5 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 31-Jan-2021  rillig lint: add a few more tests
 1.2 02-Jan-2021  rillig lint: add a few more tests

No serious bugs found this time.
 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.8 14-Oct-2024  rillig lint: add more details to messages about hidden symbols
 1.7 02-Aug-2023  rillig branches: 1.7.2;
lint: distinguish between arguments and parameters
 1.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 20-Jun-2022  rillig lint: add quotes around several placeholders in messages
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 03-Jan-2021  rillig lint: add tests for some of the messages
 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.7.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.2 03-Jan-2021  rillig lint: add tests for some of the messages
 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.7 14-Oct-2024  rillig lint: add more details to messages about hidden symbols
 1.6 28-Mar-2023  rillig branches: 1.6.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 20-Jun-2022  rillig lint: add quotes around several placeholders in messages
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 03-Jan-2021  rillig lint: add tests for some of the messages
 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.6.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.2 03-Jan-2021  rillig lint: add tests for some of the messages
 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.7 14-Oct-2024  rillig lint: add more details to messages about hidden symbols
 1.6 28-Mar-2023  rillig branches: 1.6.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 20-Jun-2022  rillig lint: add quotes around several placeholders in messages
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 03-Jan-2021  rillig lint: add tests for some of the messages
 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.6.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.2 03-Jan-2021  rillig lint: add tests for some of the messages
 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.5 19-Jun-2022  rillig lint: add quotes around placeholders in 4 messages
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.8 28-Jan-2024  rillig tests/lint: sort multiple diagnostics per line chronologically

For now, the chronologic order is not enforced but has to be established
manually, for example by removing all 'expect' comment lines and
regenerating them with 'accept.sh -u'.

While here, clean up a few instances that came up when regenerating the
'expect' comments, such as wrong indentation or needless deviation from
the 'expect+1' form.
 1.7 07-Jul-2023  rillig lint: only skip 'unused' warnings after errors, not other warnings

Previously, in -w mode, any warning suppressed further 'unused'
warnings, even though there was no need to do that. This can be seen in
the test gcc_attribute_var.c, where only the last unused variable from a
function was marked as unused, the others slipped through.

Fixed by counting the errors and the warnings separately and only
combining them if actually desired.
 1.6 28-Mar-2023  rillig lint: warn about 'extern' declarations inside function bodies

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html

The previous attempt (message 351 about 'extern' declarations outside
headers) did not cover the proposal from the tech-userlevel mailing list
but instead warns about a different usage pattern of the 'extern'
keyword.
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 21-Jun-2022  rillig lint: add quotes and details to some more messages
 1.3 03-Apr-2022  rillig tests/lint: make a few tests self-contained, add some others
 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.4 17-Jun-2022  rillig 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'.
 1.3 03-Apr-2022  rillig tests/lint: make a few tests self-contained, add some others
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.4 20-Jun-2022  rillig lint: add quotes around several placeholders in messages
 1.3 03-Apr-2022  rillig tests/lint: make a few tests self-contained, add some others
 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.4 17-Jun-2022  rillig 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'.
 1.3 03-Apr-2022  rillig tests/lint: make a few tests self-contained, add some others
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.7 28-Jan-2024  rillig tests/lint: sort multiple diagnostics per line chronologically

For now, the chronologic order is not enforced but has to be established
manually, for example by removing all 'expect' comment lines and
regenerating them with 'accept.sh -u'.

While here, clean up a few instances that came up when regenerating the
'expect' comments, such as wrong indentation or needless deviation from
the 'expect+1' form.
 1.6 07-Jul-2023  rillig 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.5 07-Jul-2023  rillig lint: only skip 'unused' warnings after errors, not other warnings

Previously, in -w mode, any warning suppressed further 'unused'
warnings, even though there was no need to do that. This can be seen in
the test gcc_attribute_var.c, where only the last unused variable from a
function was marked as unused, the others slipped through.

Fixed by counting the errors and the warnings separately and only
combining them if actually desired.
 1.4 21-Jun-2022  rillig lint: add quotes and details to some more messages
 1.3 03-Apr-2022  rillig tests/lint: make a few tests self-contained, add some others
 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.4 17-Jun-2022  rillig 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'.
 1.3 03-Apr-2022  rillig tests/lint: make a few tests self-contained, add some others
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 07-Jul-2023  rillig 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.5 21-Jun-2022  rillig lint: add quotes and details to some more messages
 1.4 03-Apr-2022  rillig tests/lint: make a few tests self-contained, add some others
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 07-Jan-2021  rillig lint: add tests for messages 93, 94, 95, 96, 97, 98, 99
 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.4 17-Jun-2022  rillig 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'.
 1.3 03-Apr-2022  rillig tests/lint: make a few tests self-contained, add some others
 1.2 07-Jan-2021  rillig lint: add tests for messages 93, 94, 95, 96, 97, 98, 99
 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.7 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.6 07-Jul-2023  rillig branches: 1.6.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.5 21-Jun-2022  rillig lint: add quotes and details to some more messages
 1.4 03-Apr-2022  rillig tests/lint: make a few tests self-contained, add some others
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 07-Jan-2021  rillig lint: add tests for messages 93, 94, 95, 96, 97, 98, 99
 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.6.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 03-Apr-2022  rillig tests/lint: make a few tests self-contained, add some others
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 07-Jan-2021  rillig lint: add tests for messages 93, 94, 95, 96, 97, 98, 99
 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.8 28-Jan-2024  rillig tests/lint: sort multiple diagnostics per line chronologically

For now, the chronologic order is not enforced but has to be established
manually, for example by removing all 'expect' comment lines and
regenerating them with 'accept.sh -u'.

While here, clean up a few instances that came up when regenerating the
'expect' comments, such as wrong indentation or needless deviation from
the 'expect+1' form.
 1.7 07-Jul-2023  rillig lint: only skip 'unused' warnings after errors, not other warnings

Previously, in -w mode, any warning suppressed further 'unused'
warnings, even though there was no need to do that. This can be seen in
the test gcc_attribute_var.c, where only the last unused variable from a
function was marked as unused, the others slipped through.

Fixed by counting the errors and the warnings separately and only
combining them if actually desired.
 1.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 21-Jun-2022  rillig lint: add quotes and details to some more messages
 1.4 03-Apr-2022  rillig tests/lint: make a few tests self-contained, add some others
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 07-Jan-2021  rillig lint: add tests for messages 93, 94, 95, 96, 97, 98, 99
 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.4 17-Jun-2022  rillig 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'.
 1.3 03-Apr-2022  rillig tests/lint: make a few tests self-contained, add some others
 1.2 07-Jan-2021  rillig lint: add tests for messages 93, 94, 95, 96, 97, 98, 99
 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.7 07-Jul-2023  rillig 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 21-Jun-2022  rillig lint: add quotes and details to some more messages
 1.5 03-Apr-2022  rillig tests/lint: make a few tests self-contained, add some others
 1.4 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 07-Jan-2021  rillig lint: add tests for messages 93, 94, 95, 96, 97, 98, 99
 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.7 17-Jun-2022  rillig 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'.
 1.6 03-Apr-2022  rillig tests/lint: make a few tests self-contained, add some others
 1.5 03-Aug-2021  rillig lint: add quotes around placeholder in message 214

function '%s' expects to return value
 1.4 09-Apr-2021  rillig lint: quote placeholders in messages for unused variables
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 07-Jan-2021  rillig lint: add tests for messages 93, 94, 95, 96, 97, 98, 99
 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.8 12-Apr-2025  rillig lint: reword messages that apply to traditional C
 1.7 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.6 09-Jul-2023  rillig branches: 1.6.2;
lint: clean up wording in diagnostics

Use the term 'parameter' as defined in C99 3.15.
 1.5 07-Jul-2023  rillig lint: only skip 'unused' warnings after errors, not other warnings

Previously, in -w mode, any warning suppressed further 'unused'
warnings, even though there was no need to do that. This can be seen in
the test gcc_attribute_var.c, where only the last unused variable from a
function was marked as unused, the others slipped through.

Fixed by counting the errors and the warnings separately and only
combining them if actually desired.
 1.4 03-Apr-2022  rillig tests/lint: make a few tests self-contained, add some others
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 07-Jan-2021  rillig lint: add tests for messages 93, 94, 95, 96, 97, 98, 99
 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.6.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 03-Apr-2022  rillig tests/lint: make a few tests self-contained, add some others
 1.3 03-Jul-2021  rillig lint: do not define 'long double' GCC builtins for traditional C
 1.2 07-Jan-2021  rillig lint: add tests for messages 93, 94, 95, 96, 97, 98, 99
 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.8 12-Apr-2025  rillig lint: reword messages that apply to traditional C
 1.7 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.6 09-Jul-2023  rillig branches: 1.6.2;
lint: clean up wording in diagnostics

Use the term 'parameter' as defined in C99 3.15.
 1.5 03-Apr-2022  rillig tests/lint: make a few tests self-contained, add some others
 1.4 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 07-Jan-2021  rillig lint: add tests for messages 93, 94, 95, 96, 97, 98, 99
 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.6.2.1 02-Aug-2025  perseant Sync with HEAD
 1.6 17-Jun-2022  rillig 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'.
 1.5 03-Apr-2022  rillig tests/lint: make a few tests self-contained, add some others
 1.4 03-Jul-2021  rillig lint: do not define 'long double' GCC builtins for traditional C
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 07-Jan-2021  rillig lint: add tests for messages 93, 94, 95, 96, 97, 98, 99
 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.6 07-Jul-2023  rillig 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.5 03-Apr-2022  rillig tests/lint: make a few tests self-contained, add some others
 1.4 26-Mar-2021  rillig lint: add quotes around placeholder in message about undefined variable

Before: error: expected undefined [99]
After: error: 'expected' undefined [99]

Seen in external/mpl/bind, which for Clang defines in stdatomic.h:
> #define atomic_exchange_explicit(obj, desired, order) \
> __c11_atomic_exchange_explicit(obj, expected, order)
Note the mismatch between 'desired' and 'expected'.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 07-Jan-2021  rillig lint: add tests for messages 93, 94, 95, 96, 97, 98, 99
 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.6 17-Jun-2022  rillig 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'.
 1.5 03-Apr-2022  rillig tests/lint: make a few tests self-contained, add some others
 1.4 26-Mar-2021  rillig lint: add quotes around placeholder in message about undefined variable

Before: error: expected undefined [99]
After: error: 'expected' undefined [99]

Seen in external/mpl/bind, which for Clang defines in stdatomic.h:
> #define atomic_exchange_explicit(obj, desired, order) \
> __c11_atomic_exchange_explicit(obj, expected, order)
Note the mismatch between 'desired' and 'expected'.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 07-Jan-2021  rillig lint: add tests for messages 93, 94, 95, 96, 97, 98, 99
 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.8 12-Apr-2025  rillig lint: reword messages that apply to traditional C
 1.7 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.6 20-Jun-2022  rillig branches: 1.6.4;
lint: add quotes around several placeholders in messages
 1.5 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.4 16-Apr-2022  rillig lint: model C language levels in a future-compatible way

The options -t, -s and -S are confusing because they are used
inconsistently. The option -S enables C99 features, but when using it
instead of -s, it also doesn't enable all checks required by C90 and
later. Prepare fixing of these inconsistencies by replacing the flag
variables with language levels that can be extended in a
straight-forward way as new C standards arrive.

| option | allow_trad | allow_c90 | allow_c99 | allow_c11 |
|--------|------------|-----------|-----------|-----------|
| -t | x | - | - | - |
| (none) | x | x | - | - |
| -s | - | x | - | - |
| -S | - | x | x | - |
| -Ac11 | - | x | x | x |

Each usage of the old flag variables will be inspected and migrated
individually, to clean up the subtle variations in the conditions and to
provide a simpler model.

When lint was created in 1995, its focus was migrating traditional C
code to C90 code. Lint does not help in migrating from C90 to C99 or
from C99 to C11 since there are only few silent changes, and simply
because nobody took the time to implement these migration aids. If
necessary, such migration modes could be added separately.

There is a small functional change: when the option -s is combined with
either -S or -Ac11, lint now only keeps the last of these options.
Previously, these options could be combined, leading to a mixture of
language levels, halfway between C90, C99 and C11. Especially combining
traditional C with C11 doesn't make sense, but xlint currently allows
it.

The 3 tests that accidentally specified multiple language levels have
been adjusted to a single language level.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.6.4.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.3 28-Mar-2021  rillig lint: only define GCC builtins if -g is given

This removes 7 wrong warnings when running lint in -t mode.

Surprisingly, this added a warning that had not been there before in
msg_189.c. This is because check_variable_usage skips the checks when
an error occurred before. All diagnostics that happened were warnings,
but the -w option treats them as errors, see vwarning.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.10 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.9 04-Jul-2021  rillig lint: replace wrong assumption with citation from C99

No functional change.
 1.8 04-Jul-2021  rillig lint: document where to fix missing const in lvalue-to-rvalue

No functional change.
 1.7 04-Jul-2021  rillig lint: align messages for invalid left operand of '.' or '->'
 1.6 30-Jun-2021  rillig lint: fix type name in message 101 for wrong member name
 1.5 30-Jun-2021  rillig tests/lint: extend tests for message 101

This demonstrates the wrong type name in the message.
 1.4 30-Mar-2021  rillig lint: add type information for message about unknown member name
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.9 17-Jun-2022  rillig 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'.
 1.8 04-Jul-2021  rillig lint: replace wrong assumption with citation from C99

No functional change.
 1.7 04-Jul-2021  rillig lint: align messages for invalid left operand of '.' or '->'
 1.6 30-Jun-2021  rillig lint: fix type name in message 101 for wrong member name
 1.5 30-Jun-2021  rillig tests/lint: extend tests for message 101

This demonstrates the wrong type name in the message.
 1.4 30-Mar-2021  rillig lint: add type information for message about unknown member name
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.7 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.6 30-Jun-2023  rillig branches: 1.6.2;
lint: fix handling of unnamed struct/union members

The support for unnamed struct/union members that was added in decl.c
1.60 from 2015-10-13 was simple but wrong. It didn't cover initializers
of these structures and computed wrong sizes for structures containing
anonymous unions. At that time, the handling of initializers was broken
as well, it was fixed 6 years later in init.c 1.229 from 2021-12-22.

Real-life examples for code that lint couldn't handle are:

* external/bsd/jemalloc/dist/src/jemalloc.c
* external/mit/xorg/lib/dri.old/Makefile
 1.5 30-Jun-2023  rillig tests/lint: add more tests for sizeof, offsetof, alignof
 1.4 19-Jun-2022  rillig lint: add quotes around placeholders in 4 messages
 1.3 14-Dec-2021  rillig tests/lint: demonstrate missing support for anonymous members
 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.6.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 14-Dec-2021  rillig tests/lint: demonstrate missing support for anonymous members
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 07-Jul-2023  rillig 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.4 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.3 04-Jul-2021  rillig lint: align messages for invalid left operand of '.' or '->'
 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.4 17-Jun-2022  rillig 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'.
 1.3 04-Jul-2021  rillig lint: align messages for invalid left operand of '.' or '->'
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 07-Jul-2023  rillig 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.4 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.3 04-Jul-2021  rillig lint: align messages for invalid left operand of '.' or '->'
 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.4 17-Jun-2022  rillig 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'.
 1.3 04-Jul-2021  rillig lint: align messages for invalid left operand of '.' or '->'
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.4 19-Jun-2022  rillig branches: 1.4.4;
lint: add quotes around placeholders in 4 messages
 1.3 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 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.4.4.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 07-Jul-2023  rillig 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.3 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 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.4 17-Jun-2022  rillig 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'.
 1.3 15-Jun-2022  rillig tests/lint: replace 'expect' comments with 'expect+-' comments

The 'expect+-' comments provide more context, which makes it easier to
read the .c files on their own, without having to look up the actual
diagnostics in the .exp files.

Add tests for messages 105 and 106, which were about the obscure feature
of some traditional C compilers that allowed the expression 'x->member'
to access a struct member, even if 'x' had integer type.

The remaining tests will be migrated in a future commit.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.7 07-Jan-2024  rillig tests/lint: test operators, integer overflow, conversions
 1.6 07-Jul-2023  rillig 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.5 03-Jun-2023  rillig lint: provide more detailed types when operands do not match
 1.4 19-Jun-2022  rillig lint: add quotes around placeholders in 4 messages
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.9 07-Jul-2023  rillig 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.8 22-May-2023  rillig lint: rename constant NOTSPEC to NO_TSPEC

It was too easy to misread the old name as NOT_SPEC instead of the
intended NO_TSPEC.
 1.7 21-Jun-2022  rillig lint: add quotes and details to some more messages
 1.6 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.5 28-Feb-2021  rillig tests/lint: keep messages in test files in sync with actual messages

Each of the tests named msg_*.c repeats the template of the message, to
make the test somewhat self-contained when viewed in isolation.

This creates a redundancy, and keeping track of this manually is next to
impossible. I tried it and failed in 9 cases, even though it has just
been 2 months since I myself created the initial files and I knew all
the time that this redundancy exists.

Be fool-proof for the future by checking this automatically.
 1.4 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.3 09-Jan-2021  rillig lint: fix crash for error 108 (invalid type of unary operator)
 1.2 09-Jan-2021  rillig lint: add test for message 108, which currently crashes
 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.5 17-Jun-2022  rillig 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'.
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 09-Jan-2021  rillig lint: fix crash for error 108 (invalid type of unary operator)
 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.8 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.7 06-Aug-2023  rillig branches: 1.7.2;
lint: since C99, a non-void function must return a value
 1.6 07-Jul-2023  rillig 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.5 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.4 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.7.2.1 02-Aug-2025  perseant Sync with HEAD
 1.7 17-Jun-2022  rillig 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'.
 1.6 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.5 03-Aug-2021  rillig lint: add quotes around placeholder in message 214

function '%s' expects to return value
 1.4 09-Apr-2021  rillig lint: quote placeholders in messages for unused variables
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.4 07-Jul-2023  rillig 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.3 25-Jul-2021  rillig tests/lint: test function types and pointer arithmetic
 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.4 17-Jun-2022  rillig 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'.
 1.3 25-Jul-2021  rillig tests/lint: test function types and pointer arithmetic
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.3 16-Jun-2022  rillig branches: 1.3.4;
tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 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.3.4.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 07-Jul-2023  rillig 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.4 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.7 07-Jul-2023  rillig 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 21-Jun-2022  rillig lint: add quotes and details to some more messages
 1.5 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.4 31-Jan-2021  rillig lint: document that message 108 doesn't abort anymore
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.7 17-Jun-2022  rillig 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'.
 1.6 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.5 09-Apr-2021  rillig lint: quote placeholders in messages for unused variables
 1.4 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.3 31-Jan-2021  rillig lint: document that message 108 doesn't abort anymore
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.11 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.10 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.9 16-Aug-2021  rillig tests/lint: document history of initialization of const members
 1.8 14-Aug-2021  rillig lint: allow initialization of struct with constant member

The operator INIT, just like RETURN and FARG, initializes an object with
an expression. The target object of such an initialization may be a
struct with constant members.

The operator ASSIGN, on the other hand, is entirely different. It
overwrites the existing value of the object, and this is not allowed for
structs that have a constant member. Therefore it was wrong to use the
operator ASSIGN for initialization.
 1.7 10-Aug-2021  rillig lint: fix 3 of the 4 wrong messages about lvalue in initial assignment
 1.6 31-Jul-2021  rillig tests/lint: demonstrate more wrong warnings for const struct members

The code 't_const = false' occurs 4 times in the lint code, each
corresponding to one of the wrong warnings in the test.

This bug has been existing at least since 2001. Back then, the lint
output was:

2001.12.24.20.52.09
| (23): lint error: popctrl() 1
| (15): syntax error [249]
| (19): warning: left operand of 'FARG' must be modifiable lvalue [115]
| (21): syntax error [249]
| (23): warning: function initialize_const_struct_member falls off bottom without returning value [217]
| exit status 1

from 2002.12.06.03.27.39
| (23): lint error: func.c, 168: popctrl()
| (15): warning: left operand of '=' must be modifiable lvalue [115]
| (19): warning: left operand of 'FARG' must be modifiable lvalue [115]
| (21): syntax error [249]
| (23): warning: function initialize_const_struct_member falls off bottom without returning value [217]
| exit status 1
until 2003.10.27.00.12.44
 1.5 31-Jul-2021  rillig tests/lint: demonstrate wrong error message for initialization

Seen in usr.bin/make/var.c:4022 in C99 mode, where a ModChain variable
is initialized and two of the members are const-qualified.
 1.4 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.3 17-Jan-2021  rillig lint: add test for incrementing const variable
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.10 17-Jun-2022  rillig 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'.
 1.9 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.8 16-Aug-2021  rillig tests/lint: document history of initialization of const members
 1.7 14-Aug-2021  rillig lint: allow initialization of struct with constant member

The operator INIT, just like RETURN and FARG, initializes an object with
an expression. The target object of such an initialization may be a
struct with constant members.

The operator ASSIGN, on the other hand, is entirely different. It
overwrites the existing value of the object, and this is not allowed for
structs that have a constant member. Therefore it was wrong to use the
operator ASSIGN for initialization.
 1.6 10-Aug-2021  rillig lint: fix 3 of the 4 wrong messages about lvalue in initial assignment
 1.5 31-Jul-2021  rillig tests/lint: demonstrate more wrong warnings for const struct members

The code 't_const = false' occurs 4 times in the lint code, each
corresponding to one of the wrong warnings in the test.

This bug has been existing at least since 2001. Back then, the lint
output was:

2001.12.24.20.52.09
| (23): lint error: popctrl() 1
| (15): syntax error [249]
| (19): warning: left operand of 'FARG' must be modifiable lvalue [115]
| (21): syntax error [249]
| (23): warning: function initialize_const_struct_member falls off bottom without returning value [217]
| exit status 1

from 2002.12.06.03.27.39
| (23): lint error: func.c, 168: popctrl()
| (15): warning: left operand of '=' must be modifiable lvalue [115]
| (19): warning: left operand of 'FARG' must be modifiable lvalue [115]
| (21): syntax error [249]
| (23): warning: function initialize_const_struct_member falls off bottom without returning value [217]
| exit status 1
until 2003.10.27.00.12.44
 1.4 31-Jul-2021  rillig tests/lint: demonstrate wrong error message for initialization

Seen in usr.bin/make/var.c:4022 in C99 mode, where a ModChain variable
is initialized and two of the members are const-qualified.
 1.3 17-Jan-2021  rillig lint: add test for incrementing const variable
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.7 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.6 07-Jul-2023  rillig branches: 1.6.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.5 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.4 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.3 09-Jan-2021  rillig lint: add test for 116 "illegal pointer subtraction"
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.6.2.1 02-Aug-2025  perseant Sync with HEAD
 1.6 17-Jun-2022  rillig 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'.
 1.5 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.4 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.3 09-Jan-2021  rillig lint: add test for 116 "illegal pointer subtraction"
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.16 14-Sep-2025  rillig lint: warn about signed '<<' that ends up exactly in the msb
 1.15 14-Sep-2025  rillig lint: add more type details to several messages

In most expressions, the integer promotions are performed on the
operands, making the actual type different from the "visible" type of an
operand. To properly explain the situation, mention the type before the
integer promotions in case it differs from the resulting type.
 1.14 07-Jul-2023  rillig 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.13 29-Jan-2023  rillig lint: don't warn about negative '>>' when the actual value is positive
 1.12 29-Jan-2023  rillig tests/lint: merge tests for '>>'
 1.11 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.10 04-Sep-2021  rillig tests/lint: provide more background information on signed '>>'
 1.9 27-Aug-2021  rillig tests/lint: document correct lint warnings for '>>'

The previous commit contained wrong assumptions. Upon closer
inspection, the lint warning is correct.
 1.8 27-Aug-2021  rillig tests/lint: test wrong warning for bitwise '>>'

Seen in /usr/include/netbt/hci.h, function hci_filter_set.
 1.7 15-Aug-2021  rillig lint: fix wrong warning about 'unsigned char >> constant'
 1.6 15-Aug-2021  rillig tests/lint: demonstrate wrong warning about signed '>>'

Seen in libdes/ostr2key.c(81).
 1.5 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.4 31-Jan-2021  rillig lint: mention the operator in messages about bit shifts
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 09-Jan-2021  rillig lint: add tests for messages 117, 120, 125, 127
 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.11 17-Jun-2022  rillig 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'.
 1.10 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.9 04-Sep-2021  rillig tests/lint: provide more background information on signed '>>'
 1.8 27-Aug-2021  rillig tests/lint: document correct lint warnings for '>>'

The previous commit contained wrong assumptions. Upon closer
inspection, the lint warning is correct.
 1.7 27-Aug-2021  rillig tests/lint: test wrong warning for bitwise '>>'

Seen in /usr/include/netbt/hci.h, function hci_filter_set.
 1.6 15-Aug-2021  rillig lint: fix wrong warning about 'unsigned char >> constant'
 1.5 15-Aug-2021  rillig tests/lint: demonstrate wrong warning about signed '>>'

Seen in libdes/ostr2key.c(81).
 1.4 06-Apr-2021  rillig lint: add details to warning about too large shift amount

The previous message 'shift greater than size of object' was too short
to give reasonable hints, especially when the expressions involve
typedefs or macros.
 1.3 31-Jan-2021  rillig lint: mention the operator in messages about bit shifts
 1.2 09-Jan-2021  rillig lint: add tests for messages 117, 120, 125, 127
 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.9 06-Sep-2025  rillig lint: reword message for bit-shift in trad-C90 migration mode

Mentioning the type names gives a hint about why the behavior differs;
the message only occurs when the type of the shift amount has higher
rank than the type of the shifted value.
 1.8 26-Aug-2023  rillig lint: make diagnostics about ANSI C more international
 1.7 07-Jul-2023  rillig 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 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.5 04-May-2021  rillig tests/lint: make test for message 118 platform-independent
 1.4 06-Apr-2021  rillig lint: for shift in C99 mode, do not warn about difference to pre-C90

C99 is too far away from traditional C to make this warning useful.
There are 3 different situations in which this warning is generated:

For '1 << (unsigned char)1', the result type is 'unsigned int' in
traditional C. The result type is unsigned because at least 1 of the
operators is unsigned, and it is 'unsigned int' because the usual
arithmetic promotions are applied.

For '1 >> (long)1', as well as for '1 << (long)1', the result type is
'long' in traditional C since the usual arithmetic promotions are
applied.

Omitting this warning in C99 mode reduces the amount of lint warnings in
a typical NetBSD release build by approximately 6800 of 107000 total.
 1.3 28-Feb-2021  rillig tests/lint: add test for '<<' in traditional C
 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.4 17-Jun-2022  rillig 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'.
 1.3 04-May-2021  rillig tests/lint: make test for message 118 platform-independent
 1.2 28-Feb-2021  rillig tests/lint: add test for '<<' in traditional C
 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.1 06-Sep-2025  rillig lint: reword message for bit-shift in trad-C90 migration mode

Mentioning the type names gives a hint about why the behavior differs;
the message only occurs when the type of the shift amount has higher
rank than the type of the shifted value.
 1.4 07-Jul-2023  rillig 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.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.8 14-Sep-2025  rillig lint: add more type details to several messages

In most expressions, the integer promotions are performed on the
operands, making the actual type different from the "visible" type of an
operand. To properly explain the situation, mention the type before the
integer promotions in case it differs from the resulting type.
 1.7 07-Jul-2023  rillig 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 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.5 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.4 31-Jan-2021  rillig lint: mention the operator in messages about bit shifts
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 09-Jan-2021  rillig lint: add tests for messages 117, 120, 125, 127
 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.6 17-Jun-2022  rillig 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'.
 1.5 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.4 06-Apr-2021  rillig lint: add details to warning about too large shift amount

The previous message 'shift greater than size of object' was too short
to give reasonable hints, especially when the expressions involve
typedefs or macros.
 1.3 31-Jan-2021  rillig lint: mention the operator in messages about bit shifts
 1.2 09-Jan-2021  rillig lint: add tests for messages 117, 120, 125, 127
 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.7 07-Jul-2023  rillig 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 19-Jun-2022  rillig lint: add quotes around placeholders in 4 messages
 1.5 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.4 06-Apr-2021  rillig lint: test what happens for 'int << double'

I just wanted to see whether typeok_shift would be reached in this case,
to ensure that is_uinteger applies as expected. It does.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 06-Apr-2021  rillig lint: test what happens for 'int << double'

I just wanted to see whether typeok_shift would be reached in this case,
to ensure that is_uinteger applies as expected. It does.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.6 07-Jul-2023  rillig 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.5 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.4 06-Apr-2021  rillig lint: add details to warning about too large shift amount

The previous message 'shift greater than size of object' was too short
to give reasonable hints, especially when the expressions involve
typedefs or macros.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 06-Apr-2021  rillig lint: add details to warning about too large shift amount

The previous message 'shift greater than size of object' was too short
to give reasonable hints, especially when the expressions involve
typedefs or macros.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.9 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.8 03-Jun-2023  rillig branches: 1.8.2;
lint: provide more detailed types when operands do not match
 1.7 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.6 19-Jun-2022  rillig lint: add quotes around placeholders in 4 messages
 1.5 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.4 04-Dec-2021  rillig lint: add quotes around placeholders in message 123
 1.3 16-Aug-2021  rillig tests/lint: add tests for several messages about type mismatch
 1.2 17-Jan-2021  rillig lint: add test for ordered comparison between incompatible types
 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.8.2.1 02-Aug-2025  perseant Sync with HEAD
 1.7 17-Jun-2022  rillig 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'.
 1.6 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.5 04-Dec-2021  rillig lint: add quotes around placeholders in message 123
 1.4 16-Aug-2021  rillig tests/lint: add tests for several messages about type mismatch
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 17-Jan-2021  rillig lint: add test for ordered comparison between incompatible types
 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.16 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.15 26-Aug-2023  rillig branches: 1.15.2;
lint: make diagnostics about ANSI C more international
 1.14 07-Jul-2023  rillig lint: only skip 'unused' warnings after errors, not other warnings

Previously, in -w mode, any warning suppressed further 'unused'
warnings, even though there was no need to do that. This can be seen in
the test gcc_attribute_var.c, where only the last unused variable from a
function was marked as unused, the others slipped through.

Fixed by counting the errors and the warnings separately and only
combining them if actually desired.
 1.13 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.12 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.11 14-Aug-2021  rillig lint: use standard quoting style for messages 124 and 184
 1.10 10-Jul-2021  rillig tests/lint: move test for __attribute__ out of msg_124.c

That test case didn't belong there since there was no chance of getting
an 'illegal pointer combination' by applying an operator.
 1.9 13-Apr-2021  christos add a test for a type attribute after a param function pointer
 1.8 28-Feb-2021  rillig tests/lint: keep messages in test files in sync with actual messages

Each of the tests named msg_*.c repeats the template of the message, to
make the test somewhat self-contained when viewed in isolation.

This creates a redundancy, and keeping track of this manually is next to
impossible. I tried it and failed in 9 cases, even though it has just
been 2 months since I myself created the initial files and I knew all
the time that this redundancy exists.

Be fool-proof for the future by checking this automatically.
 1.7 15-Feb-2021  rillig tests/lint: fix comments in test for message 124
 1.6 24-Jan-2021  rillig lint: fix wrong warning about null pointer comparison
 1.5 24-Jan-2021  rillig lint: demonstrate wrong 124 for flipped == as well

Since the fix in the next commit changes two places in the code, there
must be two wrong error messages that disappear then.
 1.4 24-Jan-2021  rillig lint: demonstrate wrong 124 due to bug in is_typeok_eq
 1.3 24-Jan-2021  rillig lint: document bug in typeok_eq

Since rt is an alias for rn->tn_type->t_tspec, it cannot be PTR and VOID
at the same time. This makes the condition unsatisfiable. Removing
that part of the code didn't show any change in behavior, as expected.

It may even be that fixing this obvious bug doesn't show any change in
behavior since that function is only used in a single place and
check_pointer_comparison performs its own checks before issuing any
warning.

At least the test cases added to msg_124.c all run as expected.
 1.2 03-Jan-2021  rillig lint: add test for message 124 "illegal pointer combination"

The message may be correct, but it is not helpful in any way. There are
just too many function pointers that may differ in a very small detail.

Before tyname.c 1.20 from 2021-01-02, the string representation of type
names was often limited to only 63 characters. Because of this, it made
sense to omit any detail that could need more space than this. Now that
this limitation is gone, it's reasonable to add more detail to the type
information, especially since that information is readily available.
 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
 1.13 17-Jun-2022  rillig 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'.
 1.12 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.11 14-Aug-2021  rillig lint: use standard quoting style for messages 124 and 184
 1.10 14-Aug-2021  rillig lint: allow initialization of struct with constant member

The operator INIT, just like RETURN and FARG, initializes an object with
an expression. The target object of such an initialization may be a
struct with constant members.

The operator ASSIGN, on the other hand, is entirely different. It
overwrites the existing value of the object, and this is not allowed for
structs that have a constant member. Therefore it was wrong to use the
operator ASSIGN for initialization.
 1.9 24-Jan-2021  rillig lint: fix wrong warning about null pointer comparison
 1.8 24-Jan-2021  rillig lint: demonstrate wrong 124 for flipped == as well

Since the fix in the next commit changes two places in the code, there
must be two wrong error messages that disappear then.
 1.7 24-Jan-2021  rillig lint: demonstrate wrong 124 due to bug in is_typeok_eq
 1.6 24-Jan-2021  rillig lint: document bug in typeok_eq

Since rt is an alias for rn->tn_type->t_tspec, it cannot be PTR and VOID
at the same time. This makes the condition unsatisfiable. Removing
that part of the code didn't show any change in behavior, as expected.

It may even be that fixing this obvious bug doesn't show any change in
behavior since that function is only used in a single place and
check_pointer_comparison performs its own checks before issuing any
warning.

At least the test cases added to msg_124.c all run as expected.
 1.5 05-Jan-2021  rillig lint: clean up symbolic operator names that are used in the messages

Including the "p" in the symbolic operator names was questionable, for
several reasons:

1. The "p" could be taken to mean an actual variable name, which is
confusing if the function doesn't have such a variable, or even more
so if the line contains an unrelated variable called "p".

2. For the binary operators, having the "p" mentioned on both sides of
the operator (such as in "p + p") wrongly suggested that both
operands of the expression were the same.

3. The name "p" often stands for a pointer. Most of the operators
don't accept pointers, therefore the name was misleading.

For these reasons, the "p" was removed from the symbolic name of all
operators. This makes several pairs of operators indistinguishable:

INCBEF == INCAFT
DECBEF == DECAFT
UPLUS == PLUS
UMINUS == MINUS
STAR == MULT
AMPER == AND

This is not expected to create any confusion since C programmers are
expected to know these double meanings.

The symbolic names for SHLASS and SHRASS were missing the '=' before.
This was added since omitting it was probably an oversight.
 1.4 03-Jan-2021  rillig lint: add detailed type information for functions
 1.3 03-Jan-2021  rillig lint: add type information to message 124 "illegal pointer combination"
 1.2 03-Jan-2021  rillig lint: add test for message 124 "illegal pointer combination"

The message may be correct, but it is not helpful in any way. There are
just too many function pointers that may differ in a very small detail.

Before tyname.c 1.20 from 2021-01-02, the string representation of type
names was often limited to only 63 characters. Because of this, it made
sense to omit any detail that could need more space than this. Now that
this limitation is gone, it's reasonable to add more detail to the type
information, especially since that information is readily available.
 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.6 26-Aug-2023  rillig lint: make diagnostics about ANSI C more international
 1.5 07-Jul-2023  rillig 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.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 09-Jan-2021  rillig lint: add tests for messages 117, 120, 125, 127
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 09-Jan-2021  rillig lint: add tests for messages 117, 120, 125, 127
 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.9 09-Dec-2024  rillig tests/lint: test more cases of type mismatch in '?:'
 1.8 06-Aug-2023  rillig branches: 1.8.2;
lint: since C99, a non-void function must return a value
 1.7 07-Jul-2023  rillig 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 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.5 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.4 28-Feb-2021  rillig tests/lint: keep messages in test files in sync with actual messages

Each of the tests named msg_*.c repeats the template of the message, to
make the test somewhat self-contained when viewed in isolation.

This creates a redundancy, and keeping track of this manually is next to
impossible. I tried it and failed in 9 cases, even though it has just
been 2 months since I myself created the initial files and I knew all
the time that this redundancy exists.

Be fool-proof for the future by checking this automatically.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.8.2.1 02-Aug-2025  perseant Sync with HEAD
 1.8 17-Jun-2022  rillig 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'.
 1.7 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.6 03-Aug-2021  rillig lint: add quotes around placeholder in message 214

function '%s' expects to return value
 1.5 09-Apr-2021  rillig lint: quote placeholders in messages for unused variables
 1.4 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.3 17-Jan-2021  rillig lint: add type information to message 126
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.6 10-Mar-2025  rillig lint: in C99 mode and later, warn about non-prototype functions

Suggested by Christos Zoulas.
 1.5 24-Feb-2025  rillig lint: remove no-op variant of the unary '&' operator

Neither K&R 1978 nor any of the C standards mentions that &function or
&array would be a no-op. This no-op behavior produced wrong warnings in
sbin/gpt.
 1.4 16-Jun-2022  rillig branches: 1.4.4;
tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 09-Jan-2021  rillig lint: add tests for messages 117, 120, 125, 127
 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.4.4.1 02-Aug-2025  perseant Sync with HEAD
 1.6 17-Jun-2022  rillig 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'.
 1.5 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.4 03-Jul-2021  rillig lint: do not define 'long double' GCC builtins for traditional C
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 09-Jan-2021  rillig lint: add tests for messages 117, 120, 125, 127
 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.10 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.9 23-Nov-2024  rillig lint: add details to messages about discarding qualifiers

The related message 153 is left as-is, as it is used in two places, and
the second place is not only about discarded qualifiers.
 1.8 28-Jan-2024  rillig branches: 1.8.2;
tests/lint: sort multiple diagnostics per line chronologically

For now, the chronologic order is not enforced but has to be established
manually, for example by removing all 'expect' comment lines and
regenerating them with 'accept.sh -u'.

While here, clean up a few instances that came up when regenerating the
'expect' comments, such as wrong indentation or needless deviation from
the 'expect+1' form.
 1.7 07-Jul-2023  rillig 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 07-Jul-2023  rillig lint: only skip 'unused' warnings after errors, not other warnings

Previously, in -w mode, any warning suppressed further 'unused'
warnings, even though there was no need to do that. This can be seen in
the test gcc_attribute_var.c, where only the last unused variable from a
function was marked as unused, the others slipped through.

Fixed by counting the errors and the warnings separately and only
combining them if actually desired.
 1.5 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 16-Mar-2021  rillig tests/lint: add test for message 128 about incompatible pointers
 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.8.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 16-Mar-2021  rillig tests/lint: add test for message 128 about incompatible pointers
 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.11 17-Sep-2025  rillig lint: answer two questions from the code by writing tests for them
 1.10 29-Oct-2024  rillig lint: fix warning about null effect in GCC statement expressions
 1.9 29-Oct-2024  rillig tests/lint: demonstrate wrong warning about 'null effect'

Seen in sys/timevar.h:250 and other places.
 1.8 02-Aug-2023  rillig branches: 1.8.2;
lint: distinguish between arguments and parameters
 1.7 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.6 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.5 21-Aug-2021  rillig lint: do not warn about '(void)arg' and similar expressions

In the current NetBSD build, 5260 of the 46264 total lint warnings are
about expressions that have a null effect. Most of these occurrences
follow well-established patterns, which makes the warnings bogus.
Remove these warnings.
 1.4 21-Aug-2021  rillig tests/lint: demonstrate wrong warnings for 'null effect' expressions
 1.3 30-Jan-2021  rillig lint: fix wrong 'expression has null effect'
 1.2 30-Jan-2021  rillig lint: add test for 129, possibly demonstrating a bug in lint
 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.8.2.1 02-Aug-2025  perseant Sync with HEAD
 1.7 17-Jun-2022  rillig 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'.
 1.6 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.5 21-Aug-2021  rillig lint: do not warn about '(void)arg' and similar expressions

In the current NetBSD build, 5260 of the 46264 total lint warnings are
about expressions that have a null effect. Most of these occurrences
follow well-established patterns, which makes the warnings bogus.
Remove these warnings.
 1.4 21-Aug-2021  rillig tests/lint: demonstrate wrong warnings for 'null effect' expressions
 1.3 30-Jan-2021  rillig lint: fix wrong 'expression has null effect'
 1.2 30-Jan-2021  rillig lint: add test for 129, possibly demonstrating a bug in lint
 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.17 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.16 28-Mar-2023  rillig branches: 1.16.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.15 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.14 25-May-2021  rillig tests/lint: make test 130 platform-independent

On 32-bit platforms such as i386 and sparc, sizeof(int) == sizeof(long),
which produced an additional unintended lint error message:

msg_130.c(78): error: duplicate case in switch: 4 [199]
 1.13 02-Apr-2021  rillig branches: 1.13.2;
tests/lint: add test for enum type mismatch
 1.12 21-Mar-2021  rillig lint: fix reachability for if-then-else statements
 1.11 10-Mar-2021  rillig lint: disable check for enum type mismatch in switch statement

This check has been too quick and broke the lint build. Among others,
lib/libpuffs has -w included in LINTFLAGS, which means that the build
can fail even for new warnings, not only for errors.

libpuffs compares a uint16_t with constants from an unnamed enum type.
Since the enum type is completely unnamed (neither a tag nor a typedef),
there is no way to define a struct member having this type. This was a
scenario that I just didn't consider when I added the check to lint.

For now, disable the new check completely. The previously existing lint
checks stay enabled, including the one that warns about mismatched
anonymous enum types in the '==' operator, which is very similar to the
now disabled check.
 1.10 09-Mar-2021  rillig tests/lint: add example for anonymous enum type in switch expression
 1.9 09-Mar-2021  rillig tests/lint: add tests for comparison between unnamed enums

Since unnamed enum types cannot be used in type casts, there is no
sensible way that this type mismatch could be resolved, without changing
the definition of the enum type itself, but that may be in a
non-modifiable header.

Therefore, comparisons with enum constants of unnamed types cannot be
sensibly warned about.
 1.8 05-Mar-2021  rillig lint: warn about enum/enum or enum/int type mismatch in switch

This is something that neither GCC 10 nor Clang 8 do, even though it
seems useful. Lint didn't do it up to now, but that was probably an
oversight since it is easy to miss the implicit '==' operator in the
switch statement.
 1.7 05-Mar-2021  rillig tests/lint: mark tests for messages 130 and 241 as related
 1.6 05-Mar-2021  rillig tests/lint: add test for incompatible enums in switch

Neither lint nor GCC 10 nor Clang 8 have a warning for an enum type
mismatch in a switch statement.

GCC 10 issues a warning but completely misses the point of the
mismatched enum types. It only warns because in this test, EVENING has
the numeric value 3, which is out of bounds for enum color, where the
valid range is from 0 to 2. It says:

> msg_130.c:45:2: warning:
> case value ‘3’ not in enumerated type ‘enum color’ [-Wswitch]

Clang 8 behaves almost the same, it just doesn't mention the value of
the constant, saying merely 'case value not in enumerated type'.
 1.5 28-Feb-2021  rillig lint: add type information to enum type mismatch
 1.4 27-Feb-2021  rillig tests/lint: add more tests for enum mismatch
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.13.2.1 31-May-2021  cjep sync with head
 1.16.2.1 02-Aug-2025  perseant Sync with HEAD
 1.12 17-Jun-2022  rillig 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'.
 1.11 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.10 21-Mar-2021  rillig lint: fix reachability for if-then-else statements
 1.9 10-Mar-2021  rillig lint: disable check for enum type mismatch in switch statement

This check has been too quick and broke the lint build. Among others,
lib/libpuffs has -w included in LINTFLAGS, which means that the build
can fail even for new warnings, not only for errors.

libpuffs compares a uint16_t with constants from an unnamed enum type.
Since the enum type is completely unnamed (neither a tag nor a typedef),
there is no way to define a struct member having this type. This was a
scenario that I just didn't consider when I added the check to lint.

For now, disable the new check completely. The previously existing lint
checks stay enabled, including the one that warns about mismatched
anonymous enum types in the '==' operator, which is very similar to the
now disabled check.
 1.8 09-Mar-2021  rillig tests/lint: add example for anonymous enum type in switch expression
 1.7 09-Mar-2021  rillig tests/lint: add tests for comparison between unnamed enums

Since unnamed enum types cannot be used in type casts, there is no
sensible way that this type mismatch could be resolved, without changing
the definition of the enum type itself, but that may be in a
non-modifiable header.

Therefore, comparisons with enum constants of unnamed types cannot be
sensibly warned about.
 1.6 05-Mar-2021  rillig lint: warn about enum/enum or enum/int type mismatch in switch

This is something that neither GCC 10 nor Clang 8 do, even though it
seems useful. Lint didn't do it up to now, but that was probably an
oversight since it is easy to miss the implicit '==' operator in the
switch statement.
 1.5 05-Mar-2021  rillig tests/lint: mark tests for messages 130 and 241 as related
 1.4 28-Feb-2021  rillig lint: add type information to enum type mismatch
 1.3 27-Feb-2021  rillig tests/lint: add more tests for enum mismatch
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 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.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.56 14-Sep-2025  rillig lint: warn about signed '<<' that ends up exactly in the msb
 1.55 14-Sep-2025  rillig lint: add more type details to several messages

In most expressions, the integer promotions are performed on the
operands, making the actual type different from the "visible" type of an
operand. To properly explain the situation, mention the type before the
integer promotions in case it differs from the resulting type.
 1.54 08-Jul-2025  rillig lint: reword message about 'extra bits set to 0'

The word 'extra' in the previous wording was too unspecific to make
sense of. In the reworded message, focus on the problem instead of
mentioning only the effect.
 1.53 03-Jan-2025  rillig tests/lint: move a platform-specific test

The test failed on i386, as ptrdiff_t fits in a uint32_t after
conversion, thus not generating a warning.
 1.52 02-Jan-2025  rillig lint: fix possible loss of accuracy in multiplication and division
 1.51 02-Jan-2025  rillig lint: fix assertion failure in pointer subtraction
 1.50 02-Jan-2025  rillig lint: fix a few wrong warnings about possible loss of accuracy
 1.49 02-Jan-2025  rillig lint: compute integer constraints for xor and minus

These operators allow lint to correctly track the possible values in
expressions that sign-extend an integer.
 1.48 01-Jan-2025  rillig lint: fix wrong warning about possible loss of accuracy

The expression "'0' + random() % 10" always fits in a signed or unsigned
char.
 1.47 01-Jan-2025  rillig tests/lint: demonstrate wrong warnings for 'char = int + long'
 1.46 12-Oct-2024  rillig lint: reduce wrong warnings about loss of accuracy in signed '%'
 1.45 12-Oct-2024  rillig tests/lint: extend test for integer constraints
 1.44 08-Oct-2024  rillig lint: compute integer constraints for unsigned multiplication

This fixes the wrong warning about possible loss of accuracy in
libc/c16rtomb.
 1.43 08-Oct-2024  rillig tests/lint: test integer constraint on multiplication
 1.42 18-Aug-2024  rillig lint: add value propagation for '/' combined with bit operations

Fixes __SHIFTIN/__SHIFTOUT expressions, as in PR toolchain/58617.
 1.41 18-Aug-2024  rillig tests/lint: demonstrate wrong warning about accuracy loss

Demonstrates PR toolchain/58617.
 1.40 01-May-2024  rillig branches: 1.40.2;
lint: fix warning about out-of-bounds bit-field value
 1.39 01-May-2024  rillig lint: demonstrate wrong warning about out-of-range bit-field
 1.38 25-Mar-2024  rillig lint: fix warnings about loss of accuracy on bit-field operations
 1.37 25-Mar-2024  rillig tests/lint: demonstrate wrong warnings about lossy bit field operations
 1.36 12-Mar-2024  rillig tests/lint: extend test for previously wrong warning about bit-fields
 1.35 12-Mar-2024  rillig lint: fix warning about loss of conversion for unsigned bit-fields

Since decl.c 1.180 from 2021-05-02.
 1.34 12-Mar-2024  rillig tests/lint: demonstrate wrong warning when comparing a bit-field

Since decl.c 1.180 from 2021-05-02, which allowed arbitrary integer
types to be used as the underlying type for bit-fields in GCC mode.
 1.33 28-Jan-2024  rillig tests/lint: sort multiple diagnostics per line chronologically

For now, the chronologic order is not enforced but has to be established
manually, for example by removing all 'expect' comment lines and
regenerating them with 'accept.sh -u'.

While here, clean up a few instances that came up when regenerating the
'expect' comments, such as wrong indentation or needless deviation from
the 'expect+1' form.
 1.32 06-Aug-2023  rillig lint: since C99, a non-void function must return a value
 1.31 03-Jun-2023  rillig lint: provide more detailed types when operands do not match
 1.30 09-May-2023  rillig lint: track integer constraints through conditional expressions
 1.29 09-May-2023  rillig lint: preserve integer constraints on cast
 1.28 09-May-2023  rillig tests/lint: demonstrate wrong warning about loss of accuracy
 1.27 09-May-2023  rillig tests/lint: demonstrate wrong warning about losing accuracy
 1.26 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.25 29-Jan-2023  rillig tests/lint: merge tests for '>>'
 1.24 07-Jul-2022  rillig tests/lint: document why in ic_expr, '&' does not need before_conversion
 1.23 06-Jul-2022  rillig lint: do not warn about 'may lose accuracy' in safe cases of '%'

The possible values of the expression 'a % b' for unsigned integers lie
between 0 and (b - 1). For signed integers, it's more complicated, so
ignore them for now.
 1.22 06-Jul-2022  rillig tests/lint: test 'may lose accuracy' for '%'

For unsigned integers, the possible range of the result can be narrowed
down by looking at the right operand of the '%'. Right now, lint
doesn't do this though.
 1.21 03-Jul-2022  rillig lint: include the width of bit-fields in the type name
 1.20 02-Jul-2022  rillig tests/lint: test bit shift with large integer types

build_bit_shift converts the right-hand operand to INT or UINT, even
though C11 6.5.7 doesn't say anything about narrowing conversions.

Traditional C says that the operators '<<' and '>>' perform the usual
arithmetic conversions. This has been dropped in C90.

What lint actually does is something completely different. In the
operators table in ops.def, the operators '<<' and '>>' are not marked
as performing the usual arithmetic conversions (column 'balance'). This
leaves all conversions to 'build_bit_shift', which converts the
right-hand side to INT or UINT. There is no obvious reason for this
conversion, as the bounds checks need to be performed no matter whether
the type is INT or UINT128.
 1.19 19-Jun-2022  rillig lint: add quotes around placeholders in 4 messages
 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 10-Jun-2022  rillig tests/lint: fix test for loss of accuracy on ILP32 platforms

The test had been wrong since msg_132.c 1.14 from 2022-05-30.

Using 'unsigned long' in a test that was intended to behave the same on
ILP32 and LP64 was an accident. Use 'unsigned long long' instead, which
is 64-bits wide on all platforms supported by lint.

Move the test about conversion from 'long' to 'int' to the
platform-specific test files.

Noticed by martin@ on powerpc.
 1.16 30-May-2022  rillig lint: fix assertion failure in '(unsigned long)(ptr) >> 12'

Since tree.c 1.449 from 2022-05-26.
 1.15 29-May-2022  rillig lint: fix wrong errors about sizeof of a bit-field (since 2022-05-26)
 1.14 29-May-2022  rillig tests/lint: demonstrate wrong errors 'size/alignment of bit-field'

Since tree.c 1.444 from 2022-05-26, which added range and bit checks for
integer expressions, not taking into account that querying for the size
of a bit-field type triggers an error message.
 1.13 26-May-2022  rillig lint: do not warn about 'uint32_t = uint64_t >> 32'

If all possible values fit into the destination type, there is no
possibility of losing accuracy.

Enhances PR 36668.
 1.12 26-May-2022  rillig tests/lint: demonstrate wrong warnings about loss of accuracy
 1.11 26-May-2022  rillig lint: do not warn about loss in accuracy if the actual value fits

The expression 'any & 0xff' can always be assigned to 'uint8_t' without
loss of any value bits. In the same way, '(any & 0xff) << 8' can always
be assigned to 'uint16_t'.

Previously, lint warned about these cases. Fix these wrong warnings by
tracking the possible values of integer expressions across a single
expression.

Fixes PR 36668, so that <sys/endian.h> does not need to be cluttered
with useless casts anymore.
 1.10 26-May-2022  rillig tests/lint: demonstrate wrong 'may lose accuracy' warning

Reported in PR 36668, fixed in sys/sys/endian.h 1.26 from 2007-07-20,
unfixed in sys/sys/endian.h 1.29 from 2014-03-18.
 1.9 21-Apr-2022  rillig tests/lint: extend test for lossy integer conversion
 1.8 20-Apr-2022  rillig tests/lint: fix test for message 132 to be platform-independent

On i386, the test failed because the warning in line 101 was not
generated. This was because size_t on i386 is unsigned int (see
arch/i386/targparam.h, SIZEOF_TSPEC). The result of the multiplication
had type unsigned int, and message 132 does not trigger for a conversion
from unsigned int to signed int because both types have the same size
(see check_integer_conversion, portable_size_in_bits).

Change the involved type from size_t (which the original code used) to
unsigned long long (which is uint64_t on all platforms supported by
lint), so that the warning is generated on all platforms in the same
way.
 1.7 19-Apr-2022  rillig tests/lint: add test case for integer non-constant expression

Seen in sqlite3.c.
 1.6 25-Aug-2021  rillig tests/lint: test conversion from long long to intptr_t on ilp32

Seen in usr.bin/make/var.c:1608.
 1.5 06-Apr-2021  rillig lint: fix wrong warning about losing accuracy when converting to _Bool
 1.4 06-Apr-2021  rillig tests/lint: demonstrate wrong warning about losing accuracy
 1.3 28-Feb-2021  rillig tests/lint: add test for narrowing conversions

Lint can warn about narrowing conversions, it just doesn't do so by
default.

The option -a (which is included in the default LINTFLAGS in sys.mk)
only reports narrowing conversions from 'long' or larger. To get
warnings about all possible narrowing conversions, the option -a has to
be given more than once.

PR bin/14531
 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.40.2.1 02-Aug-2025  perseant Sync with HEAD
 1.18 17-Jun-2022  rillig 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'.
 1.17 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.16 10-Jun-2022  rillig tests/lint: fix test for loss of accuracy on ILP32 platforms

The test had been wrong since msg_132.c 1.14 from 2022-05-30.

Using 'unsigned long' in a test that was intended to behave the same on
ILP32 and LP64 was an accident. Use 'unsigned long long' instead, which
is 64-bits wide on all platforms supported by lint.

Move the test about conversion from 'long' to 'int' to the
platform-specific test files.

Noticed by martin@ on powerpc.
 1.15 30-May-2022  rillig lint: fix assertion failure in '(unsigned long)(ptr) >> 12'

Since tree.c 1.449 from 2022-05-26.
 1.14 29-May-2022  rillig lint: fix wrong errors about sizeof of a bit-field (since 2022-05-26)
 1.13 29-May-2022  rillig tests/lint: demonstrate wrong errors 'size/alignment of bit-field'

Since tree.c 1.444 from 2022-05-26, which added range and bit checks for
integer expressions, not taking into account that querying for the size
of a bit-field type triggers an error message.
 1.12 26-May-2022  rillig lint: do not warn about 'uint32_t = uint64_t >> 32'

If all possible values fit into the destination type, there is no
possibility of losing accuracy.

Enhances PR 36668.
 1.11 26-May-2022  rillig tests/lint: demonstrate wrong warnings about loss of accuracy
 1.10 26-May-2022  rillig lint: do not warn about loss in accuracy if the actual value fits

The expression 'any & 0xff' can always be assigned to 'uint8_t' without
loss of any value bits. In the same way, '(any & 0xff) << 8' can always
be assigned to 'uint16_t'.

Previously, lint warned about these cases. Fix these wrong warnings by
tracking the possible values of integer expressions across a single
expression.

Fixes PR 36668, so that <sys/endian.h> does not need to be cluttered
with useless casts anymore.
 1.9 26-May-2022  rillig tests/lint: demonstrate wrong 'may lose accuracy' warning

Reported in PR 36668, fixed in sys/sys/endian.h 1.26 from 2007-07-20,
unfixed in sys/sys/endian.h 1.29 from 2014-03-18.
 1.8 21-Apr-2022  rillig tests/lint: extend test for lossy integer conversion
 1.7 20-Apr-2022  rillig tests/lint: fix test for message 132 to be platform-independent

On i386, the test failed because the warning in line 101 was not
generated. This was because size_t on i386 is unsigned int (see
arch/i386/targparam.h, SIZEOF_TSPEC). The result of the multiplication
had type unsigned int, and message 132 does not trigger for a conversion
from unsigned int to signed int because both types have the same size
(see check_integer_conversion, portable_size_in_bits).

Change the involved type from size_t (which the original code used) to
unsigned long long (which is uint64_t on all platforms supported by
lint), so that the warning is generated on all platforms in the same
way.
 1.6 19-Apr-2022  rillig tests/lint: add test case for integer non-constant expression

Seen in sqlite3.c.
 1.5 25-Aug-2021  rillig tests/lint: test conversion from long long to intptr_t on ilp32

Seen in usr.bin/make/var.c:1608.
 1.4 06-Apr-2021  rillig lint: fix wrong warning about losing accuracy when converting to _Bool
 1.3 06-Apr-2021  rillig tests/lint: demonstrate wrong warning about losing accuracy
 1.2 28-Feb-2021  rillig tests/lint: add test for narrowing conversions

Lint can warn about narrowing conversions, it just doesn't do so by
default.

The option -a (which is included in the default LINTFLAGS in sys.mk)
only reports narrowing conversions from 'long' or larger. To get
warnings about all possible narrowing conversions, the option -a has to
be given more than once.

PR bin/14531
 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.5 08-Aug-2023  rillig lint: in -a mode, do not warn about integer conversions from 'int'

Since tree.c 1.552 from 2023-07-08, lint warned about integer
conversions from 'int' or 'unsigned int' to smaller integer types. This
only affected 32-bit platforms where size_t is 'unsigned int' rather
than 'unsigned long', as on these platforms, the integer ranks of 'int'
and 'long' are the same, see INT_RANK in inittyp.c.

Discovered by lib/libkvm, which fails on i386 when lint generates any
warnings.
 1.4 08-Aug-2023  rillig tests/lint: test integer conversions on ilp32 int platforms
 1.3 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.2 10-Jun-2022  rillig tests/lint: fix test for loss of accuracy on ILP32 platforms

The test had been wrong since msg_132.c 1.14 from 2022-05-30.

Using 'unsigned long' in a test that was intended to behave the same on
ILP32 and LP64 was an accident. Use 'unsigned long long' instead, which
is 64-bits wide on all platforms supported by lint.

Move the test about conversion from 'long' to 'int' to the
platform-specific test files.

Noticed by martin@ on powerpc.
 1.1 25-Aug-2021  rillig tests/lint: test conversion from long long to intptr_t on ilp32

Seen in usr.bin/make/var.c:1608.
 1.2 17-Jun-2022  rillig 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'.
 1.1 25-Aug-2021  rillig tests/lint: test conversion from long long to intptr_t on ilp32

Seen in usr.bin/make/var.c:1608.
 1.3 03-Jan-2025  rillig tests/lint: move a platform-specific test

The test failed on i386, as ptrdiff_t fits in a uint32_t after
conversion, thus not generating a warning.
 1.2 07-Jul-2023  rillig branches: 1.2.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.1 10-Jun-2022  rillig tests/lint: fix test for loss of accuracy on ILP32 platforms

The test had been wrong since msg_132.c 1.14 from 2022-05-30.

Using 'unsigned long' in a test that was intended to behave the same on
ILP32 and LP64 was an accident. Use 'unsigned long long' instead, which
is 64-bits wide on all platforms supported by lint.

Move the test about conversion from 'long' to 'int' to the
platform-specific test files.

Noticed by martin@ on powerpc.
 1.2.2.1 02-Aug-2025  perseant Sync with HEAD
 1.2 17-Jun-2022  rillig 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'.
 1.1 10-Jun-2022  rillig tests/lint: fix test for loss of accuracy on ILP32 platforms

The test had been wrong since msg_132.c 1.14 from 2022-05-30.

Using 'unsigned long' in a test that was intended to behave the same on
ILP32 and LP64 was an accident. Use 'unsigned long long' instead, which
is 64-bits wide on all platforms supported by lint.

Move the test about conversion from 'long' to 'int' to the
platform-specific test files.

Noticed by martin@ on powerpc.
 1.5 07-Jul-2023  rillig 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.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.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
 1.9 17-Jun-2022  rillig 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'.
 1.8 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.7 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.6 15-Jul-2021  rillig tests/lint: demonstrate questionable warnings for pointer casts
 1.5 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.4 17-Apr-2021  rillig tests/lint: add test for pointer cast from incomplete struct
 1.3 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.2 28-Feb-2021  rillig tests/lint: add test for 'possible pointer alignment problem [135]'
 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.5 07-Jul-2023  rillig 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.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.6 17-Jun-2022  rillig 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'.
 1.5 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.4 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.7 28-Jan-2024  rillig tests/lint: sort multiple diagnostics per line chronologically

For now, the chronologic order is not enforced but has to be established
manually, for example by removing all 'expect' comment lines and
regenerating them with 'accept.sh -u'.

While here, clean up a few instances that came up when regenerating the
'expect' comments, such as wrong indentation or needless deviation from
the 'expect+1' form.
 1.6 07-Jul-2023  rillig 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.5 01-Jul-2022  rillig lint: add quotes around operator in message 138, remove message 240

Message 138 doesn't occur in practice, it was the last one that was
missing the quotes around the placeholder.

Message 240 was also missing the quotes, but it was not reachable. There
was also no apparent benefit in warning about 'assignment of different
structures' when the message about 'assignment type mismatch' serves the
same purpose.
 1.4 01-Jul-2022  rillig tests/lint: add tests for accessing incomplete types
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 16-Mar-2021  rillig tests/lint: add test for message 139 about division by zero
 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.5 17-Jun-2022  rillig 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'.
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 16-Mar-2021  rillig tests/lint: add test for message 139 about division by zero
 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.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.17 27-Mar-2024  rillig lint: clean up; extend overflow test
 1.16 10-Mar-2024  rillig lint: add details to the message about integer overflow

Having only the operator was too unspecific to be actionable, so add the
actual numbers and the data type.
 1.15 10-Mar-2024  rillig lint: fix integer overflow detection

Previously, an unsigned operation that had a negative result went
undetected in a few cases. Now, all results that are not representable
by their type are considered overflows.

The implementation of signed shift-right had been wrong for a few
commits.
 1.14 10-Mar-2024  rillig lint: detect more cases of integer overflow in constant expressions

For unsigned integers, detect when 'a + b' wraps around.
 1.13 10-Mar-2024  rillig lint: remove wrong warning about overflow in unary '-' for unsigned
 1.12 10-Mar-2024  rillig lint: fix integer overflow in integer overflow check
 1.11 10-Mar-2024  rillig tests/lint: test integer overflow when folding constants

The test is still incomplete, yet it has discovered several bugs that
are worth fixing.
 1.10 11-Jan-2024  rillig lint: warn about integer overflow when folding constant INT_MIN / -1
 1.9 08-Jan-2024  rillig tests/lint: fix overflow test for 32-bit platforms (since yesterday)

Plain integer constants without suffix are first tried to fit into
'int', then 'long', but not 'long long'. This means that numbers larger
than 32 bits must be written with the LL suffix.
 1.8 07-Jan-2024  rillig tests/lint: test operators, integer overflow, conversions
 1.7 09-Jul-2023  rillig lint: clean up the wording of a few diagnostics
 1.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 23-Aug-2021  rillig lint: add quotes around placeholder in message 141
 1.4 23-Aug-2021  rillig lint: fix wrong warning about signed integer overflow in '-'

The newly added test cases in line 30 and 33 may or may not be worth a
warning since the expressions deal with unsigned integers, where the
behavior on overflow is well defined.
 1.3 23-Aug-2021  rillig tests/lint: demonstrate wrong warnings for integer overflow
 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.6 17-Jun-2022  rillig 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'.
 1.5 23-Aug-2021  rillig lint: add quotes around placeholder in message 141
 1.4 23-Aug-2021  rillig lint: fix wrong warning about signed integer overflow in '-'

The newly added test cases in line 30 and 33 may or may not be worth a
warning since the expressions deal with unsigned integers, where the
behavior on overflow is well defined.
 1.3 23-Aug-2021  rillig tests/lint: demonstrate wrong warnings for integer overflow
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.12 08-Jun-2024  rillig tests/lint: remove unused lint1-skip-if selector
 1.11 09-Jul-2023  rillig lint: clean up the wording of a few diagnostics
 1.10 11-Apr-2023  rillig lint: don't wrongly warn about overflow in complex constants

Seen in lib/libm.
 1.9 10-Apr-2023  rillig tests/lint: demonstrate wrong warning with complex numbers
 1.8 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.7 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.6 21-Aug-2021  rillig tests/lint: guard against typos in test environment configuration

Some tests had "lint1-only-if" without a trailing colon, others included
the trailing colon. The tests that included the trailing colon were run
even though they were supposed to be skipped, and they failed, as could
be expected.

To prevent further typos, always require the trailing colon, just as in
"lint1-flags" and fail fast on unknown "lint1" comments.
 1.5 13-Jul-2021  rillig tests/lint: skip test for floating point overflow on alpha

On alpha and a few other platforms (see t_integration.sh), 'long double'
has 128 bit, which under IEEE 754 rules means a decimal exponent of up
to 4932.
 1.4 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 13-Jul-2021  rillig tests/lint: skip test for floating point overflow on alpha

On alpha and a few other platforms (see t_integration.sh), 'long double'
has 128 bit, which under IEEE 754 rules means a decimal exponent of up
to 4932.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.5 07-Jul-2023  rillig 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.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.6 17-Jun-2022  rillig 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'.
 1.5 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.6 07-Jul-2023  rillig 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.5 01-Apr-2022  rillig lint: add type details to message about 'sizeof(function)'

The code in add_function is severely broken, it mixes up the return type
of the function with the argument types. For now, at least show the
guessed type in the diagnostic, to allow human readers quickly spot the
bug.

Extend the test cases in decl_direct_abstract.c to show that the
behavior differs unreasonably if the first parameter of the function is
equal to its return type.
 1.4 02-Apr-2021  rillig lint: add parentheses after sizeof, as required by share/misc/style

No functional change.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 01-Apr-2022  rillig lint: add type details to message about 'sizeof(function)'

The code in add_function is severely broken, it mixes up the return type
of the function with the argument types. For now, at least show the
guessed type in the diagnostic, to allow human readers quickly spot the
bug.

Extend the test cases in decl_direct_abstract.c to show that the
behavior differs unreasonably if the first parameter of the function is
equal to its return type.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.5 07-Jul-2023  rillig 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.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.5 07-Jul-2023  rillig 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.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.6 17-Jun-2022  rillig 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'.
 1.5 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.4 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 25-Jul-2021  rillig lint: add type information to message about invalid cast

This probably doesn't matter in practice since the compiler is supposed
to catch this kind of error. Adding the type information mainly ensures
that parsing abstract type names works as specified.
 1.3 25-Jul-2021  rillig tests/lint: test function types and pointer arithmetic
 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.5 17-Jun-2022  rillig 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'.
 1.4 25-Jul-2021  rillig lint: add type information to message about invalid cast

This probably doesn't matter in practice since the compiler is supposed
to catch this kind of error. Adding the type information mainly ensures
that parsing abstract type names works as specified.
 1.3 25-Jul-2021  rillig tests/lint: test function types and pointer arithmetic
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 07-Jul-2023  rillig 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.4 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.3 26-Aug-2021  rillig tests/lint: add tests for several messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 26-Aug-2021  rillig tests/lint: add tests for several messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.7 02-Aug-2023  rillig lint: fix plural form in message 150
 1.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 16-Mar-2021  rillig tests/lint: add tests for a few more messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 16-Mar-2021  rillig tests/lint: add tests for a few more messages
 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.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 16-Mar-2021  rillig tests/lint: add tests for a few more messages
 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.8 17-Jun-2022  rillig 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'.
 1.7 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.6 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.5 13-Jul-2021  rillig lint: fix wording of message for incomplete struct (2021-07-04)

A struct member is not an argument. In err.c 1.124 from 2021-07-04, the
wording had been changed, without noticing that the message was used
twice: once for an argument, once for a struct member.
 1.4 04-Jul-2021  rillig lint: improve wording for incomplete struct or union
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 16-Mar-2021  rillig tests/lint: add tests for a few more messages
 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.12 04-May-2025  rillig lint: add more details to message about discarding qualifiers

The name of the function (or, if not available, its type) is useful in
lines that contain more than one function call.
 1.11 24-Feb-2025  rillig lint: remove no-op variant of the unary '&' operator

Neither K&R 1978 nor any of the C standards mentions that &function or
&array would be a no-op. This no-op behavior produced wrong warnings in
sbin/gpt.
 1.10 24-Feb-2025  rillig tests/lint: add tests for constants, pointers and lost bits
 1.9 23-Nov-2024  rillig lint: use separate message when discarding a qualifier in call
 1.8 23-Nov-2024  rillig lint: add details to messages about discarding qualifiers

The related message 153 is left as-is, as it is used in two places, and
the second place is not only about discarded qualifiers.
 1.7 28-Mar-2023  rillig branches: 1.7.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.6 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.5 28-Feb-2021  rillig tests/lint: force 'expect' annotations
 1.4 28-Feb-2021  rillig lint: make messages for incompatible pointers more specific

Message 153 didn't state obviously which of the pointer types was the
one before conversion (or cast) and which was the resulting type.

Message 229 didn't have any type information at all.
 1.3 28-Feb-2021  rillig tests/lint: add tests for function pointers
 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.7.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 28-Feb-2021  rillig lint: make messages for incompatible pointers more specific

Message 153 didn't state obviously which of the pointer types was the
one before conversion (or cast) and which was the resulting type.

Message 229 didn't have any type information at all.
 1.2 28-Feb-2021  rillig tests/lint: add tests for function pointers
 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.7 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.6 28-Mar-2023  rillig branches: 1.6.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 16-Mar-2021  rillig tests/lint: add tests for a few more messages
 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.6.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 16-Mar-2021  rillig tests/lint: add tests for a few more messages
 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.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 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.10 01-Apr-2022  rillig lint: improve determination of abstract typename

Still not perfect, but at least a step in the right direction. See
decl_direct_abstract.c for the missing edge cases.

See PR#22119.
 1.9 30-Jun-2021  rillig lint: mention the name of an implicitly declared function

In the regular NetBSD builds, this happened in swab.c:65. That line
contains __predict_false, which may or may not be a macro. In other
cases, there may be more than one function call in a single line.
 1.8 30-Jun-2021  rillig tests/lint: add test for type name of enum converted to int
 1.7 28-Jun-2021  rillig lint: in C99 mode, complain about implicitly declared functions

C99, foreword, p5, item 22 lists among the major changes from C90:
"remove implicit function declaration".
 1.6 28-Jun-2021  rillig lint: fix parse error for type 'void (*)[*]'
 1.5 28-Jun-2021  rillig lint: fix type name for prototype function without parameters
 1.4 28-Jun-2021  rillig lint: add type information to message 155 (type mismatch)
 1.3 28-Jun-2021  rillig lint: turn null pointer dereference into assertion failure

Originally I only needed a message that would output the type name from
an abstract-declarator (C99 6.7.6), to see whether lint interprets the
types correctly.

Message 155 looked like a good candidate, but it only revealed more
incomplete and untested code in lint.
 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.13 17-Jun-2022  rillig 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'.
 1.12 01-Apr-2022  rillig lint: improve determination of abstract typename

Still not perfect, but at least a step in the right direction. See
decl_direct_abstract.c for the missing edge cases.

See PR#22119.
 1.11 29-Aug-2021  rillig lint: in C99 mode, make implicit function declarations an error

In tree.c 1.294 from 2021-06-28, I had already tried this, but at that
time, there were too many implicit function definitions in the NetBSD
tree. Most of them were GCC builtins, which lint did not recognize.
Therefore I had to revert to a warning in tree.c 1.302 from 2021-06-30.

In the meantime, lint has learnt to recognize compiler builtins, see
is_compiler_builtin, so try again now. The build logs from x86_64,
i386, sparc and sparc64 show no more implicit function declarations.
 1.10 30-Jun-2021  rillig lint: in C99 mode, only warn about implicit function declarations

Since tree.c 1.294 from 2021-06-28 (two days ago), lint errored out on
an implicit function declaration. In principle it is correct to do so
since C99 requires it, but in practice there are a several functions
that are not declared in the translation unit itself since they are
provided by the compiler. Typical examples for GCC and Clang are the
various functions named '__builtin_*' and '__atomic_*'.

For now, only warn about these but don't error out.
 1.9 30-Jun-2021  rillig lint: mention the name of an implicitly declared function

In the regular NetBSD builds, this happened in swab.c:65. That line
contains __predict_false, which may or may not be a macro. In other
cases, there may be more than one function call in a single line.
 1.8 30-Jun-2021  rillig tests/lint: add test for type name of enum converted to int
 1.7 28-Jun-2021  rillig lint: in C99 mode, complain about implicitly declared functions

C99, foreword, p5, item 22 lists among the major changes from C90:
"remove implicit function declaration".
 1.6 28-Jun-2021  rillig lint: fix parse error for type 'void (*)[*]'
 1.5 28-Jun-2021  rillig lint: fix type name for prototype function without parameters
 1.4 28-Jun-2021  rillig lint: add type information to message 155 (type mismatch)
 1.3 28-Jun-2021  rillig lint: turn null pointer dereference into assertion failure

Originally I only needed a message that would output the type name from
an abstract-declarator (C99 6.7.6), to see whether lint interprets the
types correctly.

Message 155 looked like a good candidate, but it only revealed more
incomplete and untested code in lint.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.8 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.7 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.6 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.5 28-Feb-2021  rillig tests/lint: keep messages in test files in sync with actual messages

Each of the tests named msg_*.c repeats the template of the message, to
make the test somewhat self-contained when viewed in isolation.

This creates a redundancy, and keeping track of this manually is next to
impossible. I tried it and failed in 9 cases, even though it has just
been 2 months since I myself created the initial files and I knew all
the time that this redundancy exists.

Be fool-proof for the future by checking this automatically.
 1.4 27-Feb-2021  rillig tests/lint: add more tests for enum mismatch
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.6 17-Jun-2022  rillig 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'.
 1.5 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.4 27-Feb-2021  rillig tests/lint: add more tests for enum mismatch
 1.3 14-Jan-2021  rillig lint: add type details to message for enum type mismatch

Before December 2020, it was cumbersome to add type information to a
message since the caller had to explicitly allocate buffers for the type
names. That's probably the reason why this crucial detail had been left
out of the warning.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.6 26-Aug-2023  rillig lint: make diagnostics about ANSI C more international
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 19-Apr-2022  rillig lint: only warn about unsigned constants in C90 migration mode

For C99 code, the difference between traditional C and C90 is not
relevant.

Seen in sqlite3.c line 30448.
 1.3 16-Mar-2021  rillig tests/lint: add tests for a few more messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 19-Apr-2022  rillig lint: only warn about unsigned constants in C90 migration mode

For C99 code, the difference between traditional C and C90 is not
relevant.

Seen in sqlite3.c line 30448.
 1.2 16-Mar-2021  rillig tests/lint: add tests for a few more messages
 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.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 16-Mar-2021  rillig tests/lint: add tests for a few more messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 16-Mar-2021  rillig tests/lint: add tests for a few more messages
 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.7 07-Jul-2023  rillig 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 22-Apr-2023  rillig tests/lint: add test for conversions to and from a union type

Additionally, fix the line numbers in another test.
 1.5 22-Apr-2023  rillig lint: do not warn about parenthesized assignment in controlling expr

Same as for GCC and Clang.
 1.4 06-Jul-2022  rillig tests/lint: add test for 'assignment in conditional context'
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.10 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.9 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.8 18-May-2022  rillig lint: do not warn about '==' on the right-hand side of ','
 1.7 18-May-2022  rillig tests/lint: add more examples for warning in comma expression
 1.6 09-Oct-2021  rillig tests/lint: add examples for bogus warning 160 and for error 323
 1.5 31-Jan-2021  rillig lint: fix strange message about nested '==' operators

If one of the nested subexpressions is parenthesized, the author
probably knew how these expressions are evaluated. Therefore don't warn
in such a situation.

Maybe the original author once made a typo and tried to initialize
variables but instead compared them, like this:

int a, b, c;

a == b == c;

This would explain the text of the message, which still sounds strange.
At least it doesn't show up as often anymore.
 1.4 31-Jan-2021  rillig lint: add more test cases for strange '==' warning 160
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 09-Jan-2021  rillig lint: add test for message 160
 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.9 17-Jun-2022  rillig 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'.
 1.8 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.7 18-May-2022  rillig lint: do not warn about '==' on the right-hand side of ','
 1.6 18-May-2022  rillig tests/lint: add more examples for warning in comma expression
 1.5 09-Oct-2021  rillig tests/lint: add examples for bogus warning 160 and for error 323
 1.4 31-Jan-2021  rillig lint: fix strange message about nested '==' operators

If one of the nested subexpressions is parenthesized, the author
probably knew how these expressions are evaluated. Therefore don't warn
in such a situation.

Maybe the original author once made a typo and tried to initialize
variables but instead compared them, like this:

int a, b, c;

a == b == c;

This would explain the text of the message, which still sounds strange.
At least it doesn't show up as often anymore.
 1.3 31-Jan-2021  rillig lint: add more test cases for strange '==' warning 160
 1.2 09-Jan-2021  rillig lint: add test for message 160
 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.13 06-Apr-2025  rillig lint: remove warning about 'constant in conditional context'

In a full NetBSD build, this warning occurs about 2400 times, making it
the top 9 warning overall. There is no evidence though that this
warning detects any real bugs, so the noise it makes is not warranted.

In this first step, the warning is still listed in the lint(7) manual
page, as removing it from there would immediately make all places with
"LINTFLAGS += -X 161" fail. These '-X 161' flags cannot be removed
first because then, the warning would step in and make the build fail.

The next step is to clean up the "-X 161" options from all LINTFLAGS,
and then the final step is to remove the warning from err.c.
 1.12 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.11 19-Jun-2023  rillig branches: 1.11.2;
tests/lint: comma operators are not allowed in constant expressions
 1.10 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.9 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.8 16-Apr-2022  rillig lint: investigate why lint only warns about some constant conditions

Noticed in lex.c, in the macro kwdef, where lint complains about the
condition containing '||' but not about the conditions containing only
'>' or '=='.
 1.7 21-Mar-2021  rillig lint: fix reachability for while (0)
 1.6 28-Feb-2021  rillig lint: do not warn about constant expressions involving sizeof

These expressions are indeed constant for a specific platform, but on
another platform their value may change. This makes them unsuspicious
and legitimate for portable code.

Seen in rump_syscalls.c, as 'sizeof(int) > sizeof(register_t)'.
 1.5 28-Feb-2021  rillig tests/lint: add test for constant expression involving sizeof
 1.4 31-Jan-2021  rillig lint: don't warn about constant condition in 'do { } while (0)'
 1.3 31-Jan-2021  rillig lint: add expectations to test for message 161
 1.2 31-Jan-2021  rillig lint: add tests for 'constant in conditional context'

One of these tests explains why 'do { } while (0)' is so usual that
there is no reason to warn about it. That warning will not survive for
long.
 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.11.2.1 02-Aug-2025  perseant Sync with HEAD
 1.9 17-Jun-2022  rillig 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'.
 1.8 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.7 16-Apr-2022  rillig lint: investigate why lint only warns about some constant conditions

Noticed in lex.c, in the macro kwdef, where lint complains about the
condition containing '||' but not about the conditions containing only
'>' or '=='.
 1.6 21-Mar-2021  rillig lint: fix reachability for while (0)
 1.5 28-Feb-2021  rillig lint: do not warn about constant expressions involving sizeof

These expressions are indeed constant for a specific platform, but on
another platform their value may change. This makes them unsuspicious
and legitimate for portable code.

Seen in rump_syscalls.c, as 'sizeof(int) > sizeof(register_t)'.
 1.4 28-Feb-2021  rillig tests/lint: add test for constant expression involving sizeof
 1.3 31-Jan-2021  rillig lint: don't warn about constant condition in 'do { } while (0)'
 1.2 31-Jan-2021  rillig lint: add tests for 'constant in conditional context'

One of these tests explains why 'do { } while (0)' is so usual that
there is no reason to warn about it. That warning will not survive for
long.
 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.9 11-May-2024  rillig lint: warn when comparing an integer to a floating point constant
 1.8 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.7 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.6 05-Sep-2021  rillig lint: do not warn about comparison 'unsigned <= 0'

Seen in scanners generated by Flex, and about 50 occurrences in the
NetBSD src and xsrc tree, all of which are not suspicious of being bugs.
 1.5 05-Sep-2021  rillig tests/lint: test comparison of 'unsigned <= 0'
 1.4 28-Aug-2021  rillig tests/lint: extend test for nonportable character comparison
 1.3 23-Aug-2021  rillig tests/lint: add tests for integer comparisons
 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.7 17-Jun-2022  rillig 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'.
 1.6 05-Sep-2021  rillig lint: do not warn about comparison 'unsigned <= 0'

Seen in scanners generated by Flex, and about 50 occurrences in the
NetBSD src and xsrc tree, all of which are not suspicious of being bugs.
 1.5 05-Sep-2021  rillig tests/lint: test comparison of 'unsigned <= 0'
 1.4 28-Aug-2021  rillig tests/lint: extend test for nonportable character comparison
 1.3 23-Aug-2021  rillig tests/lint: add tests for integer comparisons
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 07-Jul-2023  rillig 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.4 04-Jul-2021  rillig lint: remove support for obsolete GCC-style lvalue casts

Since GCC 4.0, a cast results in an rvalue.
 1.3 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.2 17-Jan-2021  rillig lint: add test for rvalue ++ after cast
 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.5 17-Jun-2022  rillig 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'.
 1.4 04-Jul-2021  rillig lint: remove support for obsolete GCC-style lvalue casts

Since GCC 4.0, a cast results in an rvalue.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 17-Jan-2021  rillig lint: add test for rvalue ++ after cast
 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.7 08-Jun-2024  rillig lint: add details to warnings about negative constant to unsigned
 1.6 07-Jul-2023  rillig 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.5 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.4 14-Aug-2021  rillig lint: allow initialization of struct with constant member

The operator INIT, just like RETURN and FARG, initializes an object with
an expression. The target object of such an initialization may be a
struct with constant members.

The operator ASSIGN, on the other hand, is entirely different. It
overwrites the existing value of the object, and this is not allowed for
structs that have a constant member. Therefore it was wrong to use the
operator ASSIGN for initialization.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 14-Aug-2021  rillig lint: allow initialization of struct with constant member

The operator INIT, just like RETURN and FARG, initializes an object with
an expression. The target object of such an initialization may be a
struct with constant members.

The operator ASSIGN, on the other hand, is entirely different. It
overwrites the existing value of the object, and this is not allowed for
structs that have a constant member. Therefore it was wrong to use the
operator ASSIGN for initialization.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.7 28-Jan-2024  rillig tests/lint: sort multiple diagnostics per line chronologically

For now, the chronologic order is not enforced but has to be established
manually, for example by removing all 'expect' comment lines and
regenerating them with 'accept.sh -u'.

While here, clean up a few instances that came up when regenerating the
'expect' comments, such as wrong indentation or needless deviation from
the 'expect+1' form.
 1.6 07-Jul-2023  rillig 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.5 07-Jul-2023  rillig lint: only skip 'unused' warnings after errors, not other warnings

Previously, in -w mode, any warning suppressed further 'unused'
warnings, even though there was no need to do that. This can be seen in
the test gcc_attribute_var.c, where only the last unused variable from a
function was marked as unused, the others slipped through.

Fixed by counting the errors and the warnings separately and only
combining them if actually desired.
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.6 08-Jun-2024  rillig lint: add details to warnings about negative constant to unsigned
 1.5 07-Jul-2023  rillig 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.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 16-May-2021  rillig lint: add more specific warning for bit-field of type plain 'int'

Previously, declaring a bit-field of type plain 'int' resulted in this
warning:

warning: nonportable bit-field type 'int' [34]

This warning was too unspecific to be actionable, and until yesterday it
didn't even include the type. In order to allow this warning to be
understood and properly fixed, describe the actual nonportability more
precisely:

warning: bit-field of type plain 'int' has
implementation-defined signedness [344]
 1.2 31-Jan-2021  rillig branches: 1.2.2;
lint: add test for lossy assignments to bit-fields (164, 166)
 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.2.2.1 31-May-2021  cjep sync with head
 1.6 17-Jun-2022  rillig 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'.
 1.5 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.4 16-May-2021  rillig lint: add more specific warning for bit-field of type plain 'int'

Previously, declaring a bit-field of type plain 'int' resulted in this
warning:

warning: nonportable bit-field type 'int' [34]

This warning was too unspecific to be actionable, and until yesterday it
didn't even include the type. In order to allow this warning to be
understood and properly fixed, describe the actual nonportability more
precisely:

warning: bit-field of type plain 'int' has
implementation-defined signedness [344]
 1.3 16-May-2021  rillig lint: add type information to unportable bit-field type

Seeing the message "unportable bit-field type 'int'" may sound strange
at first, but that's a strict interpretation of the wording in C99
6.7.2.1p4, which requires that the bit-field type is "'_Bool', 'unsigned
int' or 'signed int', or some other implementation-defined type".

The rationale for C99 6.7.2.1 explicitly lists plain 'int' among the
allowed types for bit-fields, regardless of any additional
implementation-defined types. This means that lint had interpreted this
paragraph wrong, and it should be fixed to allow plain int as well.
 1.2 31-Jan-2021  rillig branches: 1.2.2;
lint: add test for lossy assignments to bit-fields (164, 166)
 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.2.2.1 31-May-2021  cjep sync with head
 1.7 30-Mar-2024  rillig lint: reword messages about array subscripts to sound more natural
 1.6 27-Mar-2024  rillig lint: don't use 'long' in diagnostics

The size of 'long' differs between 64-bit and 32-bit platforms.
Eliminate this possible platform-dependency.
 1.5 07-Jul-2023  rillig 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.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.13 30-Mar-2024  rillig lint: do not convert array subscripts from size_t to ptrdiff_t

The C standards do not specify a fixed type for an array subscript, it
just has to be an integer type. Previously, query 4 fired for the
ubiquitous expression 'ptr[sz]' when sz had type 'size_t'.

The test platform_ilp32_long is unaffected by this change, as the
integer constant 0x80000000 has type 'unsigned int', while size_t is
'unsigned long' on those platforms, and even though the types 'unsigned
int' and 'unsigned long' have the same value space, there's still a
conversion, at least for now.
 1.12 30-Mar-2024  rillig lint: reword messages about array subscripts to sound more natural
 1.11 27-Mar-2024  rillig lint: don't use 'long' in diagnostics

The size of 'long' differs between 64-bit and 32-bit platforms.
Eliminate this possible platform-dependency.
 1.10 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.9 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.8 30-May-2022  rillig tests/lint: explain how lint represents pointer addition
 1.7 30-May-2022  rillig lint: revert 'do not pre-multiply pointer expressions' from 2022-05-26

In tree.c 1.448, removing the pre-multiplication generated wrong
warnings about out-of-bounds array access.
 1.6 30-May-2022  rillig tests/lint: demonstrate wrong warning 'array subscript cannot be'

Since tree.c 1.448 from 2022-05-26.
 1.5 25-Mar-2021  rillig lint: fix initialization for arrays with designators

From the previous commit, there was an off-by-one error left, which was
due to the interaction between designation_add_subscript and
extend_if_array_of_unknown_size.

The other crucial point was to call initstack_pop_nobrace before
accessing the "current initialization stack element". Without this
call, in msg_168.c the "current element" would point to the initializer
level for 'const char *' instead of the one for 'array of const char *'.

One more step towards supporting C99.
 1.4 25-Mar-2021  rillig lint: improve initialization of arrays with designators

Initialization is still buggy but better than before. The remaining bug
is that only the first designator determines the array size, and after
that, the array is no longer considered of unknown size. This
contradicts C99. More improvements to come.
 1.3 07-Mar-2021  rillig tests/lint: demonstrate wrong warning for array subscript

Seen in usr.bin/indent/lexi.c.
 1.2 24-Jan-2021  rillig lint: add tests for a few messages
 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.9 17-Jun-2022  rillig 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'.
 1.8 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.7 30-May-2022  rillig lint: revert 'do not pre-multiply pointer expressions' from 2022-05-26

In tree.c 1.448, removing the pre-multiplication generated wrong
warnings about out-of-bounds array access.
 1.6 30-May-2022  rillig tests/lint: demonstrate wrong warning 'array subscript cannot be'

Since tree.c 1.448 from 2022-05-26.
 1.5 25-Mar-2021  rillig lint: fix initialization for arrays with designators

From the previous commit, there was an off-by-one error left, which was
due to the interaction between designation_add_subscript and
extend_if_array_of_unknown_size.

The other crucial point was to call initstack_pop_nobrace before
accessing the "current initialization stack element". Without this
call, in msg_168.c the "current element" would point to the initializer
level for 'const char *' instead of the one for 'array of const char *'.

One more step towards supporting C99.
 1.4 25-Mar-2021  rillig lint: improve initialization of arrays with designators

Initialization is still buggy but better than before. The remaining bug
is that only the first designator determines the array size, and after
that, the array is no longer considered of unknown size. This
contradicts C99. More improvements to come.
 1.3 07-Mar-2021  rillig tests/lint: demonstrate wrong warning for array subscript

Seen in usr.bin/indent/lexi.c.
 1.2 24-Jan-2021  rillig lint: add tests for a few messages
 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.10 15-Dec-2024  rillig lint: merge duplicate code for possibly confusing precedence
 1.9 15-Dec-2024  rillig lint: add details to message about possible precedence confusion
 1.8 07-Jul-2023  rillig branches: 1.8.2;
lint: only skip 'unused' warnings after errors, not other warnings

Previously, in -w mode, any warning suppressed further 'unused'
warnings, even though there was no need to do that. This can be seen in
the test gcc_attribute_var.c, where only the last unused variable from a
function was marked as unused, the others slipped through.

Fixed by counting the errors and the warnings separately and only
combining them if actually desired.
 1.7 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.6 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.5 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.4 04-Jan-2021  rillig lint: document and demonstrate the bug in check_precedence_confusion

It took quite a while to get to the correct interpretation of this small
piece of code and to draw the right conclusions from it. Now the bug is
finally ready to be fixed, as already announced in the test.
 1.3 04-Jan-2021  rillig lint: finish the comments in check_precedence_confusion
 1.2 04-Jan-2021  rillig lint: add test for "precedence confusion possible [169]"
 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.8.2.1 02-Aug-2025  perseant Sync with HEAD
 1.7 17-Jun-2022  rillig 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'.
 1.6 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.5 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.4 04-Jan-2021  rillig lint: fix bug in "precedence confusion possible [169]"
 1.3 04-Jan-2021  rillig lint: document and demonstrate the bug in check_precedence_confusion

It took quite a while to get to the correct interpretation of this small
piece of code and to draw the right conclusions from it. Now the bug is
finally ready to be fixed, as already announced in the test.
 1.2 04-Jan-2021  rillig lint: add test for "precedence confusion possible [169]"
 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.8 06-Aug-2023  rillig lint: since C99, a non-void function must return a value
 1.7 09-Jul-2023  rillig lint: clean up wording in diagnostics

Use the term 'parameter' as defined in C99 3.15.
 1.6 07-Jul-2023  rillig 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.5 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.4 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.7 17-Jun-2022  rillig 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'.
 1.6 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.5 03-Aug-2021  rillig lint: add quotes around placeholder in message 214

function '%s' expects to return value
 1.4 09-Apr-2021  rillig lint: quote placeholders in messages for unused variables
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.9 07-Jul-2023  rillig 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.8 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.7 21-Dec-2021  rillig tests/lint: extend test for nested initializations
 1.6 23-Mar-2021  rillig lint: fix wrong error message about type mismatch in compound literal

Now that the code contains explicit markers for starting and ending an
initialization, and having the guarantee that an assertion fails
whenever some code accesses the state of the "current initialization"
even though there is no ongoing initialization gives me much more
confidence in the correctness of the code. The calls to
begin_initialization and end_initialization always appear in pairs,
enclosing the minimal amount of code necessary for initialization.

In a nutshell, global modifiable state is error-prone and hard to
understand.

A nice side effect is that the grammar no longer needs a special rule
for the outermost initializer since the functions for the debug logging
are now called explicitly.

The code that misuses the initialization state just because it needs to
temporarily store a sym_t somewhere is now clearly marked as such. A
GCC statement expression can appear anywhere and is therefore
independent of the initialization. Most probably the code can simply
refer to the local variable in the grammar rule itself, or this variable
needs to be encoded in the grammar %union. For sure there is a better
way to handle this.

There is no longer a need that the function 'declare' initializes the
initialization state, it was just the wrong place to do this.
 1.5 22-Mar-2021  rillig tests/lint: explain wrong type mismatch in compound literal

When a pointer to a compound literal is used as an initializer, lint
reports a wrong type mismatch. The details of what happens are now
documented, which allows this problem to be fixed properly.
 1.4 22-Mar-2021  rillig lint: use precise type information in message about type mismatch

While here, reword the message, avoiding operators and parentheses.

Since 2021-01-02, providing the precise type name is as easy as the
broad type classification (just replace tspec_name with type_name), and
it's definitely more useful to the human readers.
 1.3 22-Mar-2021  rillig lint: demonstrate bug in assignment of compound literal

Seen in external/mpl/bind/dist/lib/dns/rbtdb.c, update_rrsetstats.
 1.2 24-Jan-2021  rillig lint: add tests for a few messages
 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.8 17-Jun-2022  rillig 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'.
 1.7 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.6 23-Mar-2021  rillig lint: fix wrong error message about type mismatch in compound literal

Now that the code contains explicit markers for starting and ending an
initialization, and having the guarantee that an assertion fails
whenever some code accesses the state of the "current initialization"
even though there is no ongoing initialization gives me much more
confidence in the correctness of the code. The calls to
begin_initialization and end_initialization always appear in pairs,
enclosing the minimal amount of code necessary for initialization.

In a nutshell, global modifiable state is error-prone and hard to
understand.

A nice side effect is that the grammar no longer needs a special rule
for the outermost initializer since the functions for the debug logging
are now called explicitly.

The code that misuses the initialization state just because it needs to
temporarily store a sym_t somewhere is now clearly marked as such. A
GCC statement expression can appear anywhere and is therefore
independent of the initialization. Most probably the code can simply
refer to the local variable in the grammar rule itself, or this variable
needs to be encoded in the grammar %union. For sure there is a better
way to handle this.

There is no longer a need that the function 'declare' initializes the
initialization state, it was just the wrong place to do this.
 1.5 22-Mar-2021  rillig lint: use precise type information in message about type mismatch

While here, reword the message, avoiding operators and parentheses.

Since 2021-01-02, providing the precise type name is as easy as the
broad type classification (just replace tspec_name with type_name), and
it's definitely more useful to the human readers.
 1.4 22-Mar-2021  rillig lint: demonstrate bug in assignment of compound literal

Seen in external/mpl/bind/dist/lib/dns/rbtdb.c, update_rrsetstats.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 24-Jan-2021  rillig lint: add tests for a few messages
 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.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.7 09-May-2024  rillig lint: add details to message about too many initializers
 1.6 07-Jul-2023  rillig 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.5 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.4 21-Mar-2021  rillig tests/lint: clarify that a brace-enclosed initializer needs an expr
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 08-Jan-2021  rillig lint: add tests for several messages
 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.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.4 30-Mar-2021  rillig lint: add type information to message 175
 1.3 22-Feb-2021  rillig lint: change spelling of initialisation to initialization

That's the wording from the ISO C99 standard.
 1.2 24-Jan-2021  rillig lint: add tests for a few messages
 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.11 17-Jun-2022  rillig 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'.
 1.10 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.9 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.8 13-Jul-2021  rillig lint: fix wording of message for incomplete struct (2021-07-04)

A struct member is not an argument. In err.c 1.124 from 2021-07-04, the
wording had been changed, without noticing that the message was used
twice: once for an argument, once for a struct member.
 1.7 04-Jul-2021  rillig lint: improve wording for incomplete struct or union
 1.6 09-Apr-2021  rillig lint: for structs and unions, include incompleteness in the type name

This mainly helps to assess the situation where lint warns that a
pointer cast "may be troublesome", see msg_247.exp.
 1.5 30-Mar-2021  rillig lint: add type information to message 175
 1.4 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.3 22-Feb-2021  rillig lint: change spelling of initialisation to initialization

That's the wording from the ISO C99 standard.
 1.2 24-Jan-2021  rillig lint: add tests for a few messages
 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.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 26-Aug-2021  rillig tests/lint: add tests for several messages
 1.4 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.3 28-Mar-2021  rillig lint: remove wrong warning about wrong initializer type

The following code is valid:

int valid = {{{ 3 }}};

C90 3.5.7 and C99 6.7.8 both say that the "initializer for a scalar
shall be a single expression, optionally enclosed in braces". They
don't put any upper bound on the amount of braces, not even in the
"Translation limits" section.
 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.3 28-Mar-2021  rillig lint: remove wrong warning about wrong initializer type

The following code is valid:

int valid = {{{ 3 }}};

C90 3.5.7 and C99 6.7.8 both say that the "initializer for a scalar
shall be a single expression, optionally enclosed in braces". They
don't put any upper bound on the amount of braces, not even in the
"Translation limits" section.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 24-Feb-2025  rillig tests/lint: add tests for constants, pointers and lost bits
 1.4 28-Mar-2023  rillig branches: 1.4.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 24-Jan-2021  rillig lint: add tests for a few messages
 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.4.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 24-Jan-2021  rillig lint: add tests for a few messages
 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.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 24-Jan-2021  rillig lint: add tests for a few messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 24-Jan-2021  rillig lint: add tests for a few messages
 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.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 22-Dec-2021  rillig lint: fix handling of initializations

The implementation from March 2021 added proper support for designators
but didn't model the brace levels correctly. In particular, it could
not handle additional braces or omitted braces. In such a case, lint
skipped the remaining initializers from the initialization. Due to
this, type errors in the remaining initializers went unnoticed. Another
effect was that arrays of unknown size were wrongly reported as having
size 0.

Both GCC and Clang recommend placing braces around each sub-type that is
initialized, such as a struct, union or array. Postfix does not follow
these recommendations, therefore lint had to be disabled in
external/ibm-public/postfix/Makefile.inc. This commit fixes the bugs
mentioned there.
 1.3 27-Aug-2021  rillig lint: remove unused message for struct without named members

Lint has not produced this message since the rewrite of the
initializations in March 2021. Structures that consist of only unnamed
bit-fields probably don't occur in practice.
 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.5 17-Jun-2022  rillig 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'.
 1.4 22-Dec-2021  rillig lint: fix handling of initializations

The implementation from March 2021 added proper support for designators
but didn't model the brace levels correctly. In particular, it could
not handle additional braces or omitted braces. In such a case, lint
skipped the remaining initializers from the initialization. Due to
this, type errors in the remaining initializers went unnoticed. Another
effect was that arrays of unknown size were wrongly reported as having
size 0.

Both GCC and Clang recommend placing braces around each sub-type that is
initialized, such as a struct, union or array. Postfix does not follow
these recommendations, therefore lint had to be disabled in
external/ibm-public/postfix/Makefile.inc. This commit fixes the bugs
mentioned there.
 1.3 27-Aug-2021  rillig lint: remove unused message for struct without named members

Lint has not produced this message since the rewrite of the
initializations in March 2021. Structures that consist of only unnamed
bit-fields probably don't occur in practice.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 07-Jan-2021  rillig lint: add tests for some messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 07-Jan-2021  rillig lint: add tests for some messages
 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.7 21-Jul-2023  rillig lint: reword message about non-constant initializer
 1.6 21-Jul-2023  rillig tests/lint: document an example of a non-constant initializer
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 29-Mar-2021  rillig tests/lint: test initialization without braces
 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.5 17-Jun-2022  rillig 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'.
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 29-Mar-2021  rillig tests/lint: test initialization without braces
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.8 23-Nov-2024  rillig lint: add details to messages about discarding qualifiers

The related message 153 is left as-is, as it is used in two places, and
the second place is not only about discarded qualifiers.
 1.7 28-Jan-2024  rillig branches: 1.7.2;
tests/lint: sort multiple diagnostics per line chronologically

For now, the chronologic order is not enforced but has to be established
manually, for example by removing all 'expect' comment lines and
regenerating them with 'accept.sh -u'.

While here, clean up a few instances that came up when regenerating the
'expect' comments, such as wrong indentation or needless deviation from
the 'expect+1' form.
 1.6 07-Jul-2023  rillig 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.5 07-Jul-2023  rillig lint: only skip 'unused' warnings after errors, not other warnings

Previously, in -w mode, any warning suppressed further 'unused'
warnings, even though there was no need to do that. This can be seen in
the test gcc_attribute_var.c, where only the last unused variable from a
function was marked as unused, the others slipped through.

Fixed by counting the errors and the warnings separately and only
combining them if actually desired.
 1.4 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.3 16-Aug-2021  rillig tests/lint: add tests for several messages about type mismatch
 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.7.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 16-Aug-2021  rillig tests/lint: add tests for several messages about type mismatch
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.8 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.7 20-Feb-2025  rillig lint: mention the assignment operator in 'illegal combination'

In source lines that contain both a 'return' statement as well as a
function-like macro, such as the C11 atomics, seeing the word 'init' in
the diagnostic helps to see that the type conflict is not in the
'return' statement but instead in some initializer.

Seen in userspace-rcu/wfcqueue.h:147.
 1.6 09-Jul-2023  rillig branches: 1.6.2;
lint: clean up wording in diagnostics

Use the term 'parameter' as defined in C99 3.15.
 1.5 07-Jul-2023  rillig 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.4 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.3 02-Sep-2021  rillig tests/lint: test messages 183 and 187
 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.6.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 02-Sep-2021  rillig tests/lint: test messages 183 and 187
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.7 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.6 07-Jul-2023  rillig branches: 1.6.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.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 14-Aug-2021  rillig lint: use standard quoting style for messages 124 and 184
 1.3 19-Mar-2021  rillig tests/lint: add test for incompatible pointer types in return
 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.6.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 14-Aug-2021  rillig lint: use standard quoting style for messages 124 and 184
 1.2 19-Mar-2021  rillig tests/lint: add test for incompatible pointer types in return
 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.7 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.6 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.5 18-Mar-2021  rillig lint: reword message about type mismatch in initialization

Using parentheses for quotes is unusual, furthermore the previous
message didn't follow proper grammar rules, sacrificing clarity for
brevity.
 1.4 18-Mar-2021  rillig tests/lint: add test for type mismatch in initialization

Copied and adapted from d_c99_init.c.
 1.3 22-Feb-2021  rillig lint: change spelling of initialisation to initialization

That's the wording from the ISO C99 standard.
 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.6 17-Jun-2022  rillig 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'.
 1.5 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.4 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.3 18-Mar-2021  rillig lint: reword message about type mismatch in initialization

Using parentheses for quotes is unusual, furthermore the previous
message didn't follow proper grammar rules, sacrificing clarity for
brevity.
 1.2 18-Mar-2021  rillig tests/lint: add test for type mismatch in initialization

Copied and adapted from d_c99_init.c.
 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.7 29-Mar-2024  rillig lint: fix wording of warning about bit-field initializer
 1.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.4 22-Feb-2021  rillig lint: change spelling of initialisation to initialization

That's the wording from the ISO C99 standard.
 1.3 21-Feb-2021  rillig lint: add test for bit-field initialisation in traditional C
 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.6 17-Jun-2022  rillig 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'.
 1.5 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.4 28-Mar-2021  rillig lint: only define GCC builtins if -g is given

This removes 7 wrong warnings when running lint in -t mode.

Surprisingly, this added a warning that had not been there before in
msg_189.c. This is because check_variable_usage skips the checks when
an error occurred before. All diagnostics that happened were warnings,
but the -w option treats them as errors, see vwarning.
 1.3 22-Feb-2021  rillig lint: change spelling of initialisation to initialization

That's the wording from the ISO C99 standard.
 1.2 21-Feb-2021  rillig lint: add test for bit-field initialisation in traditional C
 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.6 27-Mar-2024  rillig lint: don't use 'long' in diagnostics

The size of 'long' differs between 64-bit and 32-bit platforms.
Eliminate this possible platform-dependency.
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 21-Dec-2021  rillig lint: reword message 187 about too long string literal for initializer

The previous message was imprecise in that it didn't distinguish between
non-terminating and terminating null bytes.
 1.3 02-Sep-2021  rillig tests/lint: test messages 183 and 187
 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.5 17-Jun-2022  rillig 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'.
 1.4 21-Dec-2021  rillig lint: reword message 187 about too long string literal for initializer

The previous message was imprecise in that it didn't distinguish between
non-terminating and terminating null bytes.
 1.3 02-Sep-2021  rillig tests/lint: test messages 183 and 187
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.8 12-Apr-2025  rillig lint: reword messages that apply to traditional C
 1.7 28-Jan-2024  rillig branches: 1.7.2;
tests/lint: sort multiple diagnostics per line chronologically

For now, the chronologic order is not enforced but has to be established
manually, for example by removing all 'expect' comment lines and
regenerating them with 'accept.sh -u'.

While here, clean up a few instances that came up when regenerating the
'expect' comments, such as wrong indentation or needless deviation from
the 'expect+1' form.
 1.6 07-Jul-2023  rillig lint: only skip 'unused' warnings after errors, not other warnings

Previously, in -w mode, any warning suppressed further 'unused'
warnings, even though there was no need to do that. This can be seen in
the test gcc_attribute_var.c, where only the last unused variable from a
function was marked as unused, the others slipped through.

Fixed by counting the errors and the warnings separately and only
combining them if actually desired.
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 28-Mar-2021  rillig tests/lint: add test for struct initialization in traditional C
 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.7.2.1 02-Aug-2025  perseant Sync with HEAD
 1.6 17-Jun-2022  rillig 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'.
 1.5 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.4 28-Mar-2021  rillig lint: only define GCC builtins if -g is given

This removes 7 wrong warnings when running lint in -t mode.

Surprisingly, this added a warning that had not been there before in
msg_189.c. This is because check_variable_usage skips the checks when
an error occurred before. All diagnostics that happened were warnings,
but the -w option treats them as errors, see vwarning.
 1.3 28-Mar-2021  rillig tests/lint: add test for struct initialization in traditional C
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.7 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.6 17-Jun-2022  rillig branches: 1.6.4;
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.5 26-Aug-2021  rillig tests/lint: add tests for several messages
 1.4 09-Apr-2021  rillig lint: quote placeholders in messages for unused variables
 1.3 28-Mar-2021  rillig lint: only define GCC builtins if -g is given

This removes 7 wrong warnings when running lint in -t mode.

Surprisingly, this added a warning that had not been there before in
msg_189.c. This is because check_variable_usage skips the checks when
an error occurred before. All diagnostics that happened were warnings,
but the -w option treats them as errors, see vwarning.
 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.6.4.1 02-Aug-2025  perseant Sync with HEAD
 1.6 17-Jun-2022  rillig 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'.
 1.5 26-Aug-2021  rillig tests/lint: add tests for several messages
 1.4 09-Apr-2021  rillig lint: quote placeholders in messages for unused variables
 1.3 28-Mar-2021  rillig lint: only define GCC builtins if -g is given

This removes 7 wrong warnings when running lint in -t mode.

Surprisingly, this added a warning that had not been there before in
msg_189.c. This is because check_variable_usage skips the checks when
an error occurred before. All diagnostics that happened were warnings,
but the -w option treats them as errors, see vwarning.
 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.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.3 10-Jul-2021  rillig tests/lint: add more tests for covering the grammar
 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.4 17-Jun-2022  rillig 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'.
 1.3 10-Jul-2021  rillig tests/lint: add more tests for covering the grammar
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 07-Jul-2023  rillig 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.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 09-Apr-2021  rillig lint: quote placeholders in messages for unused variables
 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.5 17-Jun-2022  rillig 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'.
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 09-Apr-2021  rillig lint: quote placeholders in messages for unused variables
 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.12 28-Sep-2024  rillig lint: handle __attribute__((__unused__)) for functions and variables

Previously, lint ignored the '__unused' marker, requiring its own /*
ARGSUSED */ marker instead.

Previously, attributes were interpreted as soon as the closing
parenthesis was parsed. For a function definition such as '__unused
static void f(void) {}', this was too early, as the attribute was not
connected to the function, as the function was not parsed yet.

Now, the 'unused' attribute is passed around by the parser, until it is
merged into the declarator where it belongs. Due to an inaccuracy in
the grammar, the 'used' attribute has to be passed through a
parameter_list, even though a parameter list is not related to
attributes. Still, it's better than before.
 1.11 27-Sep-2024  rillig tests/lint: test unused parameters and local variables
 1.10 26-Sep-2024  rillig tests/lint: test more cases of unused parameters and local variables
 1.9 12-Sep-2023  rillig branches: 1.9.2;
lint: mark unreachable function call arguments as used as well

Previously, in a '?:' expression with a constant condition, the branch
that is not taken was skipped but any identifiers in there were intended
to be marked as used. In function call expressions, this only worked
for the last argument, as the PUSH operator is not a binary operator
(see ops.def). Cover this case as well.
 1.8 12-Sep-2023  rillig lint: mark symbols that are only used in untaken '?:' branch as used
 1.7 12-Sep-2023  rillig tests/lint: show that '?:' skips untaken branches early

This is probably done to avoid wrong warnings from branches that are
only taken on other platforms, but it also generates a wrong 'unused'
warning.
 1.6 09-Jul-2023  rillig lint: clean up wording in diagnostics

Use the term 'parameter' as defined in C99 3.15.
 1.5 07-Jul-2023  rillig 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.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 09-Apr-2021  rillig lint: quote placeholders in messages for unused variables
 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.9.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.3 09-Apr-2021  rillig lint: quote placeholders in messages for unused variables
 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.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
 1.18 17-Jun-2022  rillig 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'.
 1.17 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.16 16-Jan-2022  rillig tests/lint: document why accidental double semicolons are hard to detect
 1.15 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.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.5 07-Jul-2023  rillig 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.4 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 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.6 17-Jun-2022  rillig 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'.
 1.5 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.4 11-Jul-2021  rillig lint: add quotes around placeholders in message 23 and 232
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 07-Jul-2023  rillig 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.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 27-Feb-2025  rillig lint: normalize whitespace
 1.5 27-Feb-2025  rillig lint: add details to message about conversion in 'case'
 1.4 07-Sep-2023  rillig branches: 1.4.2;
tests/lint: test case labels with out-of-bounds values
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 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.4.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 27-Mar-2024  rillig lint: don't use 'long' in diagnostics

The size of 'long' differs between 64-bit and 32-bit platforms.
Eliminate this possible platform-dependency.
 1.4 09-Jul-2023  rillig lint: clean up the wording of a few diagnostics
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: make expectation lines in the tests more detailed

This commit migrates msg_100 until msg_199.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 27-Mar-2024  rillig lint: don't use 'long' in diagnostics

The size of 'long' differs between 64-bit and 32-bit platforms.
Eliminate this possible platform-dependency.
 1.5 09-Jul-2023  rillig lint: clean up the wording of a few diagnostics
 1.4 07-Jul-2023  rillig 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.3 27-Aug-2021  rillig tests/lint: add tests for a few more messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 27-Aug-2021  rillig tests/lint: add tests for a few more messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 07-Jul-2023  rillig 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.3 26-Aug-2021  rillig tests/lint: add tests for several messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 26-Aug-2021  rillig tests/lint: add tests for several messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 07-Jul-2023  rillig 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.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.3 22-Aug-2021  rillig lint: use standard quotes in messages 203 and 271
 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.4 17-Jun-2022  rillig 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'.
 1.3 22-Aug-2021  rillig lint: use standard quotes in messages 203 and 271
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.11 06-Aug-2023  rillig lint: since C99, a non-void function must return a value
 1.10 02-Aug-2023  rillig lint: distinguish between arguments and parameters
 1.9 09-Jul-2023  rillig lint: clean up wording in diagnostics

Use the term 'parameter' as defined in C99 3.15.
 1.8 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.7 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.6 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.5 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.4 17-Jan-2021  rillig lint: rename build_ampersand to build_address

At that stage of analysis, the ampersand is no longer ambiguous, it has
already been resolved as the address-of operator, instead of the
bitwise-and operator.
 1.3 08-Jan-2021  rillig lint: fix function as controlling expression (since 2020-12-31)

It's perfectly valid to directly use a function name as the controlling
expression of an if statement. That function name is converted
implicitly to a pointer to that function, and that is a scalar value
then.

Spotted by christos in lib/libpthread/pthread.c:634.
 1.2 08-Jan-2021  rillig lint: demonstrate wrong message 204 (since 2020-12-31)

In func.c 1.39 from 2020-12-31 18:51:28, the check that controlling
expressions are indeed scalar was extended from while and for loops to
if statements as well. It just seemed to have been an oversight.

This revealed a bug in lint, which didn't accept the following valid
code snippet from lib/libpthread/pthread.c:634:

void _malloc_thread_cleanup(void) __weak;
...
if (_malloc_thread_cleanup)
_malloc_thread_cleanup();

Testing a function (instead of a function pointer) for truthiness is
probably rare since most functions are defined unconditionally. For
weak functions it comes in handy though.

Clang-Tidy suggests to prefix the function with '&' to silence its
warning. Doing that revealed a non-obvious behavior in build_ampersand,
which does not add the AMPER node to the expression even though it is
clearly mentioned in the code. That is left for further research.

Once the original bug is fixed, it probably doesn't matter whether the
AMPER is discarded or retained since check_controlling_expression would
add it back. There's probably a reason though to sometimes discard the
AMPER and sometimes retain it.
 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.8 17-Jun-2022  rillig 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'.
 1.7 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.6 03-Aug-2021  rillig lint: add quotes around placeholder in message 214

function '%s' expects to return value
 1.5 09-Apr-2021  rillig lint: quote placeholders in messages for unused variables
 1.4 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.3 08-Jan-2021  rillig lint: fix function as controlling expression (since 2020-12-31)

It's perfectly valid to directly use a function name as the controlling
expression of an if statement. That function name is converted
implicitly to a pointer to that function, and that is a scalar value
then.

Spotted by christos in lib/libpthread/pthread.c:634.
 1.2 08-Jan-2021  rillig lint: demonstrate wrong message 204 (since 2020-12-31)

In func.c 1.39 from 2020-12-31 18:51:28, the check that controlling
expressions are indeed scalar was extended from while and for loops to
if statements as well. It just seemed to have been an oversight.

This revealed a bug in lint, which didn't accept the following valid
code snippet from lib/libpthread/pthread.c:634:

void _malloc_thread_cleanup(void) __weak;
...
if (_malloc_thread_cleanup)
_malloc_thread_cleanup();

Testing a function (instead of a function pointer) for truthiness is
probably rare since most functions are defined unconditionally. For
weak functions it comes in handy though.

Clang-Tidy suggests to prefix the function with '&' to silence its
warning. Doing that revealed a non-obvious behavior in build_ampersand,
which does not add the AMPER node to the expression even though it is
clearly mentioned in the code. That is left for further research.

Once the original bug is fixed, it probably doesn't matter whether the
AMPER is discarded or retained since check_controlling_expression would
add it back. There's probably a reason though to sometimes discard the
AMPER and sometimes retain it.
 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.4 07-Jul-2023  rillig 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.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.7 07-Jul-2023  rillig 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 22-May-2022  rillig lint: fix wrong warning about unhandled enum constants in switch
 1.5 22-May-2022  rillig tests/lint: demonstrate wrong warning for switch on enum
 1.4 08-Jul-2021  rillig lint: fix wrong check for enum constants in switch (since today)
 1.3 08-Jul-2021  rillig lint: demonstrate bug in handling enum declarations (since today)

Since cgram.y 1.270 from today (a "cleanup" commit), the enum constants
were only registered in the symbol table, but they were not added to the
enum type (en_first_enumerator). That information is used for
validating switch statements on enum types.

The actual bug is an off-by-one error in the grammar, in the grammar
rule 'enum_declaration'. Yacc does not notice this obvious error.
Bison does, but it is not involved in building lint.

In the grammar rule 'enum_declaration', the intended $3 contains the
first enumeration constant of the type, while $2, which yacc interprets
as a symbol, contains a null pointer, at least on x86_64.

The existing tests did not cover this scenario, so the bug went
unnoticed.
 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.7 17-Jun-2022  rillig 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'.
 1.6 22-May-2022  rillig lint: fix wrong warning about unhandled enum constants in switch
 1.5 22-May-2022  rillig tests/lint: demonstrate wrong warning for switch on enum
 1.4 08-Jul-2021  rillig lint: fix wrong check for enum constants in switch (since today)
 1.3 08-Jul-2021  rillig lint: demonstrate bug in handling enum declarations (since today)

Since cgram.y 1.270 from today (a "cleanup" commit), the enum constants
were only registered in the symbol table, but they were not added to the
enum type (en_first_enumerator). That information is used for
validating switch statements on enum types.

The actual bug is an off-by-one error in the grammar, in the grammar
rule 'enum_declaration'. Yacc does not notice this obvious error.
Bison does, but it is not involved in building lint.

In the grammar rule 'enum_declaration', the intended $3 contains the
first enumeration constant of the type, while $2, which yacc interprets
as a symbol, contains a null pointer, at least on x86_64.

The existing tests did not cover this scenario, so the bug went
unnoticed.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 07-Jul-2025  rillig lint: disable message 207 about 'loop not entered at top'

The purpose of the message is unclear, and it produces several warnings
in legitimate code.
 1.5 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.4 19-Apr-2024  rillig branches: 1.4.2;
tests/lint: show how to trigger message 207
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.4.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 07-Jul-2023  rillig 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.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.7 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.6 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.5 28-Feb-2021  rillig tests/lint: keep messages in test files in sync with actual messages

Each of the tests named msg_*.c repeats the template of the message, to
make the test somewhat self-contained when viewed in isolation.

This creates a redundancy, and keeping track of this manually is next to
impossible. I tried it and failed in 9 cases, even though it has just
been 2 months since I myself created the initial files and I knew all
the time that this redundancy exists.

Be fool-proof for the future by checking this automatically.
 1.4 22-Feb-2021  rillig lint: change spelling of initialisation to initialization

That's the wording from the ISO C99 standard.
 1.3 21-Feb-2021  rillig lint: add test for enum mismatch in initialization

This warning is currently not user-friendly because it omits any type
information, but that information is crucial.
 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.7 17-Jun-2022  rillig 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'.
 1.6 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.5 28-Feb-2021  rillig lint: output precise type information for struct/union/enum

Previously, 'typedef enum { E } name' was output as 'name', which
omitted the information that this was an enum type. Now it is output as
'enum typedef name'.

Previously, 'typedef struct { int member; } name' was output as 'struct
<unnamed>', which omitted the typedef name. Now it is output as 'struct
typedef name'.
 1.4 22-Feb-2021  rillig lint: change spelling of initialisation to initialization

That's the wording from the ISO C99 standard.
 1.3 21-Feb-2021  rillig lint: add type information to message about enum mismatch
 1.2 21-Feb-2021  rillig lint: add test for enum mismatch in initialization

This warning is currently not user-friendly because it omits any type
information, but that information is crucial.
 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.9 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.8 20-Feb-2025  rillig lint: mention the assignment operator in 'illegal combination'

In source lines that contain both a 'return' statement as well as a
function-like macro, such as the C11 atomics, seeing the word 'init' in
the diagnostic helps to see that the type conflict is not in the
'return' statement but instead in some initializer.

Seen in userspace-rcu/wfcqueue.h:147.
 1.7 08-Jun-2024  rillig branches: 1.7.2;
tests/lint: reorganize tests

Tests for a single working language construct don't usually need a
separate file, they can be grouped together, like in expr.c or gcc.c.
 1.6 07-Jul-2023  rillig 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.5 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.4 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.3 16-Aug-2021  rillig tests/lint: add tests for several messages about type mismatch
 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.7.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 16-Aug-2021  rillig tests/lint: add tests for several messages about type mismatch
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 09-Jul-2023  rillig lint: clean up wording in diagnostics

Use the term 'parameter' as defined in C99 3.15.
 1.5 07-Jul-2023  rillig 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.4 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 06-Aug-2023  rillig lint: since C99, a non-void function must return a value
 1.5 07-Jul-2023  rillig 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.4 03-Aug-2021  rillig lint: add quotes around placeholder in message 214

function '%s' expects to return value
 1.3 03-Aug-2021  rillig lint: casting to a struct is not allowed in C99, only with GCC
 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.5 17-Jun-2022  rillig 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'.
 1.4 03-Aug-2021  rillig lint: add quotes around placeholder in message 214

function '%s' expects to return value
 1.3 03-Aug-2021  rillig lint: casting to a struct is not allowed in C99, only with GCC
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.13 07-Jul-2023  rillig 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.12 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.11 29-Aug-2021  rillig lint: in C99 mode, make implicit function declarations an error

In tree.c 1.294 from 2021-06-28, I had already tried this, but at that
time, there were too many implicit function definitions in the NetBSD
tree. Most of them were GCC builtins, which lint did not recognize.
Therefore I had to revert to a warning in tree.c 1.302 from 2021-06-30.

In the meantime, lint has learnt to recognize compiler builtins, see
is_compiler_builtin, so try again now. The build logs from x86_64,
i386, sparc and sparc64 show no more implicit function declarations.
 1.10 29-Aug-2021  rillig lint: add __sync_ and _mm_ as prefixes for builtin functions

These two additions cover all cases that occur in the current NetBSD
build on x86_64. This allows build_name to use the usual pattern 'if
Sflag then error else if sflag then warning'. That function currently
issues a warning in C99 as well, even though C99 prohibits implicit
function declarations.
 1.9 30-Jun-2021  rillig lint: do not warn about use of implicitly declared GCC builtins
 1.8 30-Jun-2021  rillig lint: in C99 mode, only warn about implicit function declarations

Since tree.c 1.294 from 2021-06-28 (two days ago), lint errored out on
an implicit function declaration. In principle it is correct to do so
since C99 requires it, but in practice there are a several functions
that are not declared in the translation unit itself since they are
provided by the compiler. Typical examples for GCC and Clang are the
various functions named '__builtin_*' and '__atomic_*'.

For now, only warn about these but don't error out.
 1.7 30-Jun-2021  rillig lint: mention the name of an implicitly declared function

In the regular NetBSD builds, this happened in swab.c:65. That line
contains __predict_false, which may or may not be a macro. In other
cases, there may be more than one function call in a single line.
 1.6 30-Jun-2021  rillig tests/lint: extend test for message 215 about implicit function
 1.5 30-Jun-2021  rillig lint: fix type name in message 101 for wrong member name
 1.4 30-Jun-2021  rillig tests/lint: extend and explain test for implicit function declaration
 1.3 28-Jun-2021  rillig lint: in C99 mode, complain about implicitly declared functions

C99, foreword, p5, item 22 lists among the major changes from C90:
"remove implicit function declaration".
 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.10 17-Jun-2022  rillig 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'.
 1.9 29-Aug-2021  rillig lint: in C99 mode, make implicit function declarations an error

In tree.c 1.294 from 2021-06-28, I had already tried this, but at that
time, there were too many implicit function definitions in the NetBSD
tree. Most of them were GCC builtins, which lint did not recognize.
Therefore I had to revert to a warning in tree.c 1.302 from 2021-06-30.

In the meantime, lint has learnt to recognize compiler builtins, see
is_compiler_builtin, so try again now. The build logs from x86_64,
i386, sparc and sparc64 show no more implicit function declarations.
 1.8 30-Jun-2021  rillig lint: in C99 mode, only warn about implicit function declarations

Since tree.c 1.294 from 2021-06-28 (two days ago), lint errored out on
an implicit function declaration. In principle it is correct to do so
since C99 requires it, but in practice there are a several functions
that are not declared in the translation unit itself since they are
provided by the compiler. Typical examples for GCC and Clang are the
various functions named '__builtin_*' and '__atomic_*'.

For now, only warn about these but don't error out.
 1.7 30-Jun-2021  rillig lint: mention the name of an implicitly declared function

In the regular NetBSD builds, this happened in swab.c:65. That line
contains __predict_false, which may or may not be a macro. In other
cases, there may be more than one function call in a single line.
 1.6 30-Jun-2021  rillig tests/lint: extend test for message 215 about implicit function
 1.5 30-Jun-2021  rillig lint: fix type name in message 101 for wrong member name
 1.4 30-Jun-2021  rillig tests/lint: extend and explain test for implicit function declaration
 1.3 28-Jun-2021  rillig lint: in C99 mode, complain about implicitly declared functions

C99, foreword, p5, item 22 lists among the major changes from C90:
"remove implicit function declaration".
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.7 07-Jul-2023  rillig 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 01-Oct-2022  rillig lint: add hyphen to adjective 'old-style'
 1.5 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.4 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.3 24-Apr-2022  rillig lint: error out on declarations with implicit int type
 1.2 30-Jan-2021  rillig lint: add tests that trigger a few more messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 24-Apr-2022  rillig lint: error out on declarations with implicit int type
 1.2 30-Jan-2021  rillig lint: add tests that trigger a few more messages
 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.17 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.16 30-Nov-2024  rillig tests/lint: add a few more tests to increase code coverage
 1.15 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.14 13-Nov-2024  rillig lint: handle _Noreturn, [[noreturn]] and __attribute__((__noreturn__))
 1.13 13-Nov-2024  rillig tests/lint: demonstrate missing [[noreturn]] handling
 1.12 07-Jul-2023  rillig branches: 1.12.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.11 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.10 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.9 21-Mar-2021  rillig lint: fix reachability for if-then-else statements
 1.8 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.7 21-Mar-2021  rillig tests/lint: demonstrate bug in endless loop detection
 1.6 21-Mar-2021  rillig lint: fix wrong 'falls off bottom' after return in do-while
 1.5 21-Mar-2021  rillig lint: fix wrong 'statement not reached' in do-while loop
 1.4 21-Feb-2021  rillig lint: fix wrong warning about main falling off the bottom in C99 mode

This gets lint a small step closer to implementing C99.
 1.3 31-Jan-2021  rillig lint: demonstrate wrong and misleading warnings about reachability
 1.2 30-Jan-2021  rillig lint: add tests that trigger a few more messages
 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.12.2.1 02-Aug-2025  perseant Sync with HEAD
 1.10 17-Jun-2022  rillig 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'.
 1.9 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.8 21-Mar-2021  rillig lint: fix reachability for if-then-else statements
 1.7 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.6 21-Mar-2021  rillig tests/lint: demonstrate bug in endless loop detection
 1.5 21-Mar-2021  rillig lint: fix wrong 'falls off bottom' after return in do-while
 1.4 21-Mar-2021  rillig lint: fix wrong 'statement not reached' in do-while loop
 1.3 31-Jan-2021  rillig lint: demonstrate wrong and misleading warnings about reachability
 1.2 30-Jan-2021  rillig lint: add tests that trigger a few more messages
 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.10 28-Jan-2024  rillig tests/lint: fix tests for integer constants on ILP32 platforms

The comment in msg_218 was both off-topic and wrong, so remove it.
 1.9 26-Aug-2023  rillig lint: make diagnostics about ANSI C more international
 1.8 08-Jul-2023  rillig tests/lint: fix a few ilp32 tests
 1.7 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.6 19-Feb-2023  rillig lint: do not warn about traditional C migration in C99 mode

For large integer constants, the resulting type could differ between
traditional C and C90. In C99 mode, this difference is no longer
relevant since it is too far away from traditional C.
 1.5 19-Feb-2023  rillig tests/lint: fix and extend tests for C90 migration warning
 1.4 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.8 12-Apr-2025  rillig lint: reword messages that apply to traditional C
 1.7 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.6 28-Mar-2023  rillig branches: 1.6.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 27-Feb-2022  rillig lint: concatenate string literals from left to right

Previously, the string literals "1" "2" "3" "4" were concatenated in the
order "23", "234", "1234". This influenced the location of the
diagnostics for traditional C (which doesn't know concatenation at all)
and for mixing regular strings and wide strings.

Now the diagnostics occur exactly where they are expected. The first
string literal defines whether the whole string is regular or wide, and
any further string literals must match it.

In traditional C mode, there are more diagnostics than before, but that
doesn't hurt since they are still correct and nobody uses lint in
traditional C mode anyway.
 1.4 27-Feb-2022  rillig tests/lint: test where exactly lint complains about concatenation

This only applies to traditional C and ensures that the behavior is
preserved when rearranging the C parser to evaluate string concatenation
from left to right.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 02-Jan-2021  rillig lint: demonstrate that -t mode is practically unusable

Since main1.c from 2014-04-18, running lint in -t mode produces strange
warnings in lines 1 to 3 of no file at all.

This is caused by the builtins that are parsed in main(). These
builtins are incompatible with traditional mode because they use long
double, which had not been known at that time.
 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.6.2.1 02-Aug-2025  perseant Sync with HEAD
 1.6 17-Jun-2022  rillig 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'.
 1.5 27-Feb-2022  rillig lint: concatenate string literals from left to right

Previously, the string literals "1" "2" "3" "4" were concatenated in the
order "23", "234", "1234". This influenced the location of the
diagnostics for traditional C (which doesn't know concatenation at all)
and for mixing regular strings and wide strings.

Now the diagnostics occur exactly where they are expected. The first
string literal defines whether the whole string is regular or wide, and
any further string literals must match it.

In traditional C mode, there are more diagnostics than before, but that
doesn't hurt since they are still correct and nobody uses lint in
traditional C mode anyway.
 1.4 27-Feb-2022  rillig tests/lint: test where exactly lint complains about concatenation

This only applies to traditional C and ensures that the behavior is
preserved when rearranging the C parser to evaluate string concatenation
from left to right.
 1.3 28-Mar-2021  rillig lint: only define GCC builtins if -g is given

This removes 7 wrong warnings when running lint in -t mode.

Surprisingly, this added a warning that had not been there before in
msg_189.c. This is because check_variable_usage skips the checks when
an error occurred before. All diagnostics that happened were warnings,
but the -w option treats them as errors, see vwarning.
 1.2 02-Jan-2021  rillig lint: demonstrate that -t mode is practically unusable

Since main1.c from 2014-04-18, running lint in -t mode produces strange
warnings in lines 1 to 3 of no file at all.

This is caused by the builtins that are parsed in main(). These
builtins are incompatible with traditional mode because they use long
double, which had not been known at that time.
 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.11 08-May-2025  rillig lint: fix merging type attributes
 1.10 08-May-2025  rillig tests/lint: demonstrate ignored function attributes
 1.9 28-Mar-2023  rillig branches: 1.9.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.8 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.7 29-Aug-2021  rillig lint: allow 'fallthrough' as alternative spelling of FALLTHROUGH

Seen in unbound/lookup3.c.

No change to the documentation since the canonical spelling is still the
same.
 1.6 29-Aug-2021  rillig tests/lint: test lowercase fallthrough
 1.5 29-Aug-2021  rillig lint: accept keyword variant FALL THROUGH as alias to FALLTHROUGH

Seen in archive_string.c, macro WRITE_UC.

No documentation change since the canonical spelling of this keyword
stays the same.
 1.4 29-Aug-2021  rillig tests/lint: test variants of the FALLTHROUGH comment
 1.3 12-Apr-2021  christos Add an example of attribute fallthrough
 1.2 30-Jan-2021  rillig lint: add tests that trigger a few more messages
 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.9.2.1 02-Aug-2025  perseant Sync with HEAD
 1.8 17-Jun-2022  rillig 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'.
 1.7 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.6 29-Aug-2021  rillig lint: allow 'fallthrough' as alternative spelling of FALLTHROUGH

Seen in unbound/lookup3.c.

No change to the documentation since the canonical spelling is still the
same.
 1.5 29-Aug-2021  rillig tests/lint: test lowercase fallthrough
 1.4 29-Aug-2021  rillig lint: accept keyword variant FALL THROUGH as alias to FALLTHROUGH

Seen in archive_string.c, macro WRITE_UC.

No documentation change since the canonical spelling of this keyword
stays the same.
 1.3 29-Aug-2021  rillig tests/lint: test variants of the FALLTHROUGH comment
 1.2 30-Jan-2021  rillig lint: add tests that trigger a few more messages
 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.7 08-Jun-2024  rillig lint: add details to warnings about negative constant to unsigned
 1.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.4 22-Feb-2021  rillig lint: change spelling of initialisation to initialization

That's the wording from the ISO C99 standard.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 07-Jan-2021  rillig lint: add tests for some messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.3 22-Feb-2021  rillig lint: change spelling of initialisation to initialization

That's the wording from the ISO C99 standard.
 1.2 07-Jan-2021  rillig lint: add tests for some messages
 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.8 15-Dec-2024  rillig tests/lint: test negative constant and unsigned type for all operators
 1.7 15-Dec-2024  rillig tests/lint: add practical examples for signedness mismatch
 1.6 08-Jun-2024  rillig branches: 1.6.2;
lint: add details to warnings about negative constant to unsigned
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.3 27-Aug-2021  rillig tests/lint: test some more messages
 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.6.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 27-Aug-2021  rillig tests/lint: test some more messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 07-Jul-2023  rillig 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.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 30-Jan-2021  rillig lint: add tests that trigger a few more messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 30-Jan-2021  rillig lint: add tests that trigger a few more messages
 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.5 07-Jul-2023  rillig 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.4 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.3 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.2 30-Jan-2021  rillig lint: add tests that trigger a few more messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 30-Jan-2021  rillig lint: add tests that trigger a few more messages
 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.5 07-Jul-2023  rillig 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.4 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 24-Jan-2021  rillig lint: add test for message 325, undefined static function
 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.5 17-Jun-2022  rillig 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'.
 1.4 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 24-Jan-2021  rillig lint: add test for message 325, undefined static function
 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.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 27-Aug-2021  rillig tests/lint: test some more messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 27-Aug-2021  rillig tests/lint: test some more messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 07-Jul-2023  rillig 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.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.7 07-Jul-2023  rillig 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 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.5 28-Feb-2021  rillig tests/lint: force 'expect' annotations
 1.4 28-Feb-2021  rillig lint: make messages for incompatible pointers more specific

Message 153 didn't state obviously which of the pointer types was the
one before conversion (or cast) and which was the resulting type.

Message 229 didn't have any type information at all.
 1.3 28-Feb-2021  rillig tests/lint: add tests for function pointers
 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.5 17-Jun-2022  rillig 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'.
 1.4 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.3 28-Feb-2021  rillig lint: make messages for incompatible pointers more specific

Message 153 didn't state obviously which of the pointer types was the
one before conversion (or cast) and which was the resulting type.

Message 229 didn't have any type information at all.
 1.2 28-Feb-2021  rillig tests/lint: add tests for function pointers
 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.14 07-Jul-2023  rillig 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.13 24-Jun-2023  rillig lint: don't warn about comparison between char and character constant
 1.12 22-Feb-2023  rillig lint: fix confusing message about nonportable character constants
 1.11 26-Feb-2022  rillig tests/lint: sync tests for platform-dependent character comparisons
 1.10 09-Oct-2021  rillig tests/lint: demonstrate wrong warning about nonportable char comparison

Seen in bin/sh/expand.c:273.
 1.9 09-Oct-2021  rillig lint: add more details to warning about nonportable character comparison

Especially when macros are involved, this makes it easier to see that
there is a real problem.

Seen in bin/sh/expand.c:273, where a plain char is compared to numbers
larger than 127.
 1.8 28-Aug-2021  rillig tests/lint: align tests for unsigned char and signed char
 1.7 28-Aug-2021  rillig tests/lint: extend test for nonportable character comparison
 1.6 23-Aug-2021  rillig tests/lint: add tests for integer comparisons
 1.5 21-Aug-2021  rillig tests/lint: guard against typos in test environment configuration

Some tests had "lint1-only-if" without a trailing colon, others included
the trailing colon. The tests that included the trailing colon were run
even though they were supposed to be skipped, and they failed, as could
be expected.

To prevent further typos, always require the trailing colon, just as in
"lint1-flags" and fail fast on unknown "lint1" comments.
 1.4 03-Jul-2021  rillig tests/lint: fix test for character comparison on macppc

On macppc, char == unsigned char, which generates one more warning than
on platforms where char == signed char.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 03-Jan-2021  rillig lint: add tests for some of the messages
 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.10 17-Jun-2022  rillig 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'.
 1.9 09-Oct-2021  rillig tests/lint: demonstrate wrong warning about nonportable char comparison

Seen in bin/sh/expand.c:273.
 1.8 09-Oct-2021  rillig lint: add more details to warning about nonportable character comparison

Especially when macros are involved, this makes it easier to see that
there is a real problem.

Seen in bin/sh/expand.c:273, where a plain char is compared to numbers
larger than 127.
 1.7 28-Aug-2021  rillig tests/lint: align tests for unsigned char and signed char
 1.6 28-Aug-2021  rillig tests/lint: extend test for nonportable character comparison
 1.5 23-Aug-2021  rillig tests/lint: add tests for integer comparisons
 1.4 03-Jul-2021  rillig tests/lint: fix test for character comparison on macppc

On macppc, char == unsigned char, which generates one more warning than
on platforms where char == signed char.
 1.3 05-Jan-2021  rillig lint: clean up symbolic operator names that are used in the messages

Including the "p" in the symbolic operator names was questionable, for
several reasons:

1. The "p" could be taken to mean an actual variable name, which is
confusing if the function doesn't have such a variable, or even more
so if the line contains an unrelated variable called "p".

2. For the binary operators, having the "p" mentioned on both sides of
the operator (such as in "p + p") wrongly suggested that both
operands of the expression were the same.

3. The name "p" often stands for a pointer. Most of the operators
don't accept pointers, therefore the name was misleading.

For these reasons, the "p" was removed from the symbolic name of all
operators. This makes several pairs of operators indistinguishable:

INCBEF == INCAFT
DECBEF == DECAFT
UPLUS == PLUS
UMINUS == MINUS
STAR == MULT
AMPER == AND

This is not expected to create any confusion since C programmers are
expected to know these double meanings.

The symbolic names for SHLASS and SHRASS were missing the '=' before.
This was added since omitting it was probably an oversight.
 1.2 03-Jan-2021  rillig lint: add tests for some of the messages
 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.13 08-Jul-2023  rillig tests/lint: fix a few ilp32 tests
 1.12 24-Jun-2023  rillig lint: don't warn about comparison between char and character constant
 1.11 27-Feb-2023  rillig tests/lint: sync test for nonportable character comparisons

Message 230 was changed on 2023-02-22 but only tested on signed char
platforms.
 1.10 22-Feb-2023  rillig lint: fix confusing message about nonportable character constants
 1.9 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.8 14-Mar-2022  rillig tests/lint: fix test about "non-portable character constant" on uchar

The warning is wrong, and it has been for a long time. For now just fix
the test to match the actual output. Seen on evbarm, which is one of
the platforms where a plain char is unsigned.

Noticed by Martin.
 1.7 26-Feb-2022  rillig tests/lint: sync tests for platform-dependent character comparisons
 1.6 16-Dec-2021  rillig tests/lint: ensure that tests on a message mention this message
 1.5 16-Dec-2021  rillig tests/lint: fix test on platforms where char is unsigned

In tree.c 1.385 from 2021-10-09, the format of the message changed. The
test for platforms where char is unsigned was not updated in that commit
because I had forgotten about it, and because lint1/check-msgs.lua only
checks the message in tests named exacty msg_000.c, but not msg_000_*.c.

Found by martin@.
 1.4 28-Aug-2021  rillig tests/lint: align tests for unsigned char and signed char
 1.3 28-Aug-2021  rillig tests/lint: extend test for nonportable character comparison
 1.2 21-Aug-2021  rillig tests/lint: guard against typos in test environment configuration

Some tests had "lint1-only-if" without a trailing colon, others included
the trailing colon. The tests that included the trailing colon were run
even though they were supposed to be skipped, and they failed, as could
be expected.

To prevent further typos, always require the trailing colon, just as in
"lint1-flags" and fail fast on unknown "lint1" comments.
 1.1 03-Jul-2021  rillig tests/lint: fix test for character comparison on macppc

On macppc, char == unsigned char, which generates one more warning than
on platforms where char == signed char.
 1.5 17-Jun-2022  rillig 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'.
 1.4 14-Mar-2022  rillig tests/lint: fix test about "non-portable character constant" on uchar

The warning is wrong, and it has been for a long time. For now just fix
the test to match the actual output. Seen on evbarm, which is one of
the platforms where a plain char is unsigned.

Noticed by Martin.
 1.3 16-Dec-2021  rillig tests/lint: fix test on platforms where char is unsigned

In tree.c 1.385 from 2021-10-09, the format of the message changed. The
test for platforms where char is unsigned was not updated in that commit
because I had forgotten about it, and because lint1/check-msgs.lua only
checks the message in tests named exacty msg_000.c, but not msg_000_*.c.

Found by martin@.
 1.2 28-Aug-2021  rillig tests/lint: align tests for unsigned char and signed char
 1.1 03-Jul-2021  rillig tests/lint: fix test for character comparison on macppc

On macppc, char == unsigned char, which generates one more warning than
on platforms where char == signed char.
 1.9 28-Sep-2024  rillig lint: handle __attribute__((__unused__)) for functions and variables

Previously, lint ignored the '__unused' marker, requiring its own /*
ARGSUSED */ marker instead.

Previously, attributes were interpreted as soon as the closing
parenthesis was parsed. For a function definition such as '__unused
static void f(void) {}', this was too early, as the attribute was not
connected to the function, as the function was not parsed yet.

Now, the 'unused' attribute is passed around by the parser, until it is
merged into the declarator where it belongs. Due to an inaccuracy in
the grammar, the 'used' attribute has to be passed through a
parameter_list, even though a parameter list is not related to
attributes. Still, it's better than before.
 1.8 27-Sep-2024  rillig tests/lint: test unused parameters and local variables
 1.7 26-Sep-2024  rillig tests/lint: test more cases of unused parameters and local variables
 1.6 09-Jul-2023  rillig branches: 1.6.2;
lint: clean up wording in diagnostics

Use the term 'parameter' as defined in C99 3.15.
 1.5 07-Jul-2023  rillig 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.4 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.3 09-Apr-2021  rillig lint: quote placeholders in messages for unused variables
 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.6.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.3 09-Apr-2021  rillig lint: quote placeholders in messages for unused variables
 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.7 07-Jul-2023  rillig 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 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.5 11-Jul-2021  rillig lint: add quotes around placeholders in message 23 and 232
 1.4 11-Jul-2021  rillig lint: support __attribute__((hot))

The corresponding attribute 'cold' was already added in cgram.y 1.84
from 2016-12-29.
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 10-Jan-2021  rillig lint: use message 232 for unused label in function

This message had been defined but not used before.
 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.4 17-Jun-2022  rillig 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'.
 1.3 11-Jul-2021  rillig lint: add quotes around placeholders in message 23 and 232
 1.2 10-Jan-2021  rillig lint: use message 232 for unused label in function

This message had been defined but not used before.
 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.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 27-Aug-2021  rillig tests/lint: test some more messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 27-Aug-2021  rillig tests/lint: test some more messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 11-Jun-2022  rillig tests/lint: add tests for messages that lack quotes
 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.5 17-Jun-2022  rillig 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'.
 1.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 11-Jun-2022  rillig tests/lint: add tests for messages that lack quotes
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 27-Aug-2021  rillig tests/lint: test some more messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 27-Aug-2021  rillig tests/lint: test some more messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.7 28-Sep-2024  rillig lint: treat __attribute__((__constructor__)) functions as used

Seen in jemalloc.c.
 1.6 26-Sep-2024  rillig tests/lint: demonstrate wrong warning for constructor function

Seen in jemalloc.
 1.5 07-Jul-2023  rillig branches: 1.5.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.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 11-Jun-2022  rillig tests/lint: add tests for messages that lack quotes
 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.5.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 11-Jun-2022  rillig tests/lint: add tests for messages that lack quotes
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 07-Jul-2023  rillig 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.3 11-Jun-2022  rillig lint: add quotes around placeholders for a few more messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 11-Jun-2022  rillig lint: add quotes around placeholders for a few more messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.8 12-Apr-2025  rillig lint: reword messages that apply to traditional C
 1.7 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.6 28-Mar-2023  rillig branches: 1.6.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.4 29-Mar-2021  rillig tests/lint: test initialization of union in traditional C
 1.3 22-Feb-2021  rillig lint: change spelling of initialisation to initialization

That's the wording from the ISO C99 standard.
 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.6.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.3 29-Mar-2021  rillig tests/lint: test initialization of union in traditional C
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.10 10-Apr-2025  rillig lint: do not warn about constant operand of '!'

Like its related warning about a constant condition, the purpose of this
warning is unclear, and suppressing the warning requires special lint
comments, thus cluttering the code.

The message itself is still kept in err.c to keep the '-X 239' option
valid. These LINTFLAGS will be removed in a follow-up commit.

The lint comments /* CONSTCOND */, as well as its more verbose forms /*
CONSTANTCOND */ and /* CONSTANTCONDITION */ are no longer needed and can
be removed.
 1.9 06-Apr-2025  rillig lint: remove warning about 'constant in conditional context'

In a full NetBSD build, this warning occurs about 2400 times, making it
the top 9 warning overall. There is no evidence though that this
warning detects any real bugs, so the noise it makes is not warranted.

In this first step, the warning is still listed in the lint(7) manual
page, as removing it from there would immediately make all places with
"LINTFLAGS += -X 161" fail. These '-X 161' flags cannot be removed
first because then, the warning would step in and make the build fail.

The next step is to clean up the "-X 161" options from all LINTFLAGS,
and then the final step is to remove the warning from err.c.
 1.8 02-Aug-2023  rillig branches: 1.8.2;
lint: distinguish between arguments and parameters
 1.7 07-Jul-2023  rillig 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 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.5 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.4 02-Apr-2021  rillig lint: reword message about constant argument to '!'

In the other messages, operators are typically written in their literal
form as well. Using single quotes disambiguates them from normal
punctuation.
 1.3 02-Apr-2021  rillig tests/lint: add test for constant argument to '!'
 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.8.2.1 02-Aug-2025  perseant Sync with HEAD
 1.6 17-Jun-2022  rillig 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'.
 1.5 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.4 02-Apr-2021  rillig lint: reword message about constant argument to '!'

In the other messages, operators are typically written in their literal
form as well. Using single quotes disambiguates them from normal
punctuation.
 1.3 02-Apr-2021  rillig tests/lint: add test for constant argument to '!'
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.8 02-Aug-2023  rillig lint: distinguish between arguments and parameters
 1.7 09-Jul-2023  rillig lint: clean up wording in diagnostics

Use the term 'parameter' as defined in C99 3.15.
 1.6 07-Jul-2023  rillig 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.5 07-Jul-2023  rillig lint: only skip 'unused' warnings after errors, not other warnings

Previously, in -w mode, any warning suppressed further 'unused'
warnings, even though there was no need to do that. This can be seen in
the test gcc_attribute_var.c, where only the last unused variable from a
function was marked as unused, the others slipped through.

Fixed by counting the errors and the warnings separately and only
combining them if actually desired.
 1.4 01-Jul-2022  rillig lint: add quotes around operator in message 138, remove message 240

Message 138 doesn't occur in practice, it was the last one that was
missing the quotes around the placeholder.

Message 240 was also missing the quotes, but it was not reachable. There
was also no apparent benefit in warning about 'assignment of different
structures' when the message about 'assignment type mismatch' serves the
same purpose.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.11 09-Jul-2023  rillig lint: clean up the wording of a few diagnostics
 1.10 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.9 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.8 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.7 30-Oct-2021  rillig lint: warn if an enum name is used for mismatched array access

This helps to keep the enum definition and the straight-forward
implementation of a to_string or name function in sync.

The test for message 241 had to be adjusted because of exactly this bug.
That test defined a bit mask enum but accessed it like a value enum
type.
 1.6 16-Aug-2021  rillig tests/lint: test arithmetic promotions and enums
 1.5 16-Aug-2021  rillig tests/lint: add tests for several messages about type mismatch
 1.4 27-Feb-2021  rillig tests/lint: remove stray warning 278 from test for warning 241
 1.3 27-Feb-2021  rillig tests/lint: add test for 'dubious operation on enum' [241]
 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.6 17-Jun-2022  rillig 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'.
 1.5 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.4 16-Aug-2021  rillig tests/lint: add tests for several messages about type mismatch
 1.3 27-Feb-2021  rillig tests/lint: remove stray warning 278 from test for warning 241
 1.2 27-Feb-2021  rillig tests/lint: add test for 'dubious operation on enum' [241]
 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.8 09-Jul-2023  rillig lint: clean up the wording of a few diagnostics
 1.7 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.6 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.5 29-Nov-2021  rillig tests/lint: demonstrate non-enum warning for enum type mismatch

Seen in usr.bin/make/job.c:2122.
 1.4 14-Aug-2021  rillig lint: allow initialization of struct with constant member

The operator INIT, just like RETURN and FARG, initializes an object with
an expression. The target object of such an initialization may be a
struct with constant members.

The operator ASSIGN, on the other hand, is entirely different. It
overwrites the existing value of the object, and this is not allowed for
structs that have a constant member. Therefore it was wrong to use the
operator ASSIGN for initialization.
 1.3 27-Feb-2021  rillig tests/lint: add tests for enum/int mismatch
 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.5 17-Jun-2022  rillig 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'.
 1.4 29-Nov-2021  rillig tests/lint: demonstrate non-enum warning for enum type mismatch

Seen in usr.bin/make/job.c:2122.
 1.3 14-Aug-2021  rillig lint: allow initialization of struct with constant member

The operator INIT, just like RETURN and FARG, initializes an object with
an expression. The target object of such an initialization may be a
struct with constant members.

The operator ASSIGN, on the other hand, is entirely different. It
overwrites the existing value of the object, and this is not allowed for
structs that have a constant member. Therefore it was wrong to use the
operator ASSIGN for initialization.
 1.2 27-Feb-2021  rillig tests/lint: add tests for enum/int mismatch
 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.6 09-Jul-2023  rillig lint: in the warning about ordered enums, mention the affected type
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 31-Jan-2021  rillig lint: add a few more tests
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 31-Jan-2021  rillig lint: add a few more tests
 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.5 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.4 07-Jul-2023  rillig branches: 1.4.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.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.4.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.4 28-Feb-2021  rillig lint: add type information for 'incompatible struct pointers'
 1.3 28-Feb-2021  rillig tests/lint: add test for 'illegal structure pointer combination'
 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.6 17-Jun-2022  rillig 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'.
 1.5 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.4 28-Feb-2021  rillig lint: output precise type information for struct/union/enum

Previously, 'typedef enum { E } name' was output as 'name', which
omitted the information that this was an enum type. Now it is output as
'enum typedef name'.

Previously, 'typedef struct { int member; } name' was output as 'struct
<unnamed>', which omitted the typedef name. Now it is output as 'struct
typedef name'.
 1.3 28-Feb-2021  rillig lint: add type information for 'incompatible struct pointers'
 1.2 28-Feb-2021  rillig tests/lint: add test for 'illegal structure pointer combination'
 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.7 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.6 20-Feb-2025  rillig lint: mention the assignment operator in 'illegal combination'

In source lines that contain both a 'return' statement as well as a
function-like macro, such as the C11 atomics, seeing the word 'init' in
the diagnostic helps to see that the type conflict is not in the
'return' statement but instead in some initializer.

Seen in userspace-rcu/wfcqueue.h:147.
 1.5 07-Jul-2023  rillig branches: 1.5.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.4 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.5.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.35 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.34 28-Sep-2024  rillig lint: reword warning about cast between unrelated pointer types

The phrase "may be troublesome" was too unspecific to be useful.
 1.33 07-Aug-2023  rillig branches: 1.33.2;
tests/lint: show that portable mode depends on PTRDIFF_TSPEC

Since 2023.07.08.12.45.43, lint warns in lib/libkvm on i386.
 1.32 14-Jul-2023  rillig lint: clean up comments, add a test for the '?:' operator
 1.31 07-Jul-2023  rillig lint: only skip 'unused' warnings after errors, not other warnings

Previously, in -w mode, any warning suppressed further 'unused'
warnings, even though there was no need to do that. This can be seen in
the test gcc_attribute_var.c, where only the last unused variable from a
function was marked as unused, the others slipped through.

Fixed by counting the errors and the warnings separately and only
combining them if actually desired.
 1.30 05-Jul-2023  rillig tests/lint: add platform-specific tests for troublesome pointer casts
 1.29 22-Apr-2023  rillig lint: don't warn about cast between union and one of its member types

Seen in src/sbin/newfs_udf/udf_core.c for context.anchors.
 1.28 22-Apr-2023  rillig tests/lint: add test for conversions to and from a union type

Additionally, fix the line numbers in another test.
 1.27 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.26 24-Jun-2022  rillig lint: do not warn about pointer casts to array types

If the (recursive) element type of the array is compatible, that's good
enough. Even after the previous commits, this warning is the one that
occurs most in a standard NetBSD build, and it is generally ignored.
For now, focus on reducing the number of false positives to an
acceptable level.
 1.25 24-Jun-2022  rillig tests/lint: demonstrate another warning about pointer casts
 1.24 24-Jun-2022  rillig lint: allow pointer cast between compatible structs

Lint already allowed pointer casts from 'struct counter' to 'struct
counter_impl'. Now it also allows the other direction.
 1.23 24-Jun-2022  rillig tests/lint: demonstrate warning for cast between compatible structs
 1.22 24-Jun-2022  rillig lint: do not warn about pointer cast between sockaddr variants
 1.21 24-Jun-2022  rillig tests/lint: demonstrate pointer casts between sockaddr variants
 1.20 24-Jun-2022  rillig lint: allow pointer cast from char to struct/union
 1.19 24-Jun-2022  rillig tests/lint: demonstrate dubious warnings for pointer casts

Casting a 'pointer to char' to a 'pointer to anything else' is already
allowed, except for 'pointer to struct/union'. The cause for this
inconsistency is the wrong order of checks in
'should_warn_about_pointer_cast'.
 1.18 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.17 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.16 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.15 15-Jul-2021  rillig tests/lint: demonstrate questionable warnings for pointer casts
 1.14 10-Jul-2021  rillig lint: rename clrtyp/deftyp to begin_type/end_type

The abbreviations clr/def did not make it obvious that these two
functions or grammar rules form pairs.

No functional change.
 1.13 09-Apr-2021  rillig lint: do not warn about pointer conversion to or from incomplete type

This cuts down the warnings in a NetBSD release build by about 38,000.
 1.12 09-Apr-2021  rillig tests/lint: document where the 38,000 lint warnings come from
 1.11 08-Apr-2021  rillig tests/lint: refine comment and function name in test for pointer cast

In a typical NetBSD build, there are about 100,000 lint warnings. About
50,000 of them are warning 247. About 38,000 of these are from OpenSSL
and may be fixed by now.
 1.10 08-Apr-2021  rillig lint: don't warn about cast between pointers to compatible structs
 1.9 08-Apr-2021  rillig tests/lint: add test for struct pointer cast
 1.8 30-Mar-2021  rillig tests/lint: remove outdated comments
 1.7 26-Mar-2021  rillig lint: allow pointer cast to 'char *' and 'unsigned char *'

This reduces the number of warnings in the regular NetBSD build by 5560.
 1.6 26-Mar-2021  rillig tests/lint: add tests for warning about cast to character types
 1.5 14-Mar-2021  rillig tests/lint: document how lint discards the typedef name in 247
 1.4 14-Mar-2021  rillig tests/lint: add test for message 247 for pointer to unnamed struct
 1.3 28-Feb-2021  rillig tests/lint: keep messages in test files in sync with actual messages

Each of the tests named msg_*.c repeats the template of the message, to
make the test somewhat self-contained when viewed in isolation.

This creates a redundancy, and keeping track of this manually is next to
impossible. I tried it and failed in 9 cases, even though it has just
been 2 months since I myself created the initial files and I knew all
the time that this redundancy exists.

Be fool-proof for the future by checking this automatically.
 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.33.2.1 02-Aug-2025  perseant Sync with HEAD
 1.15 17-Jun-2022  rillig 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'.
 1.14 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.13 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.12 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.11 15-Jul-2021  rillig tests/lint: demonstrate questionable warnings for pointer casts
 1.10 09-Apr-2021  rillig lint: do not warn about pointer conversion to or from incomplete type

This cuts down the warnings in a NetBSD release build by about 38,000.
 1.9 09-Apr-2021  rillig lint: for structs and unions, include incompleteness in the type name

This mainly helps to assess the situation where lint warns that a
pointer cast "may be troublesome", see msg_247.exp.
 1.8 09-Apr-2021  rillig tests/lint: document where the 38,000 lint warnings come from
 1.7 08-Apr-2021  rillig lint: don't warn about cast between pointers to compatible structs
 1.6 08-Apr-2021  rillig tests/lint: add test for struct pointer cast
 1.5 26-Mar-2021  rillig lint: allow pointer cast to 'char *' and 'unsigned char *'

This reduces the number of warnings in the regular NetBSD build by 5560.
 1.4 26-Mar-2021  rillig tests/lint: add tests for warning about cast to character types
 1.3 14-Mar-2021  rillig tests/lint: document how lint discards the typedef name in 247
 1.2 14-Mar-2021  rillig tests/lint: add test for message 247 for pointer to unnamed struct
 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.6 28-Sep-2024  rillig lint: reword warning about cast between unrelated pointer types

The phrase "may be troublesome" was too unspecific to be useful.
 1.5 07-Aug-2023  rillig branches: 1.5.2;
tests/lint: show that portable mode depends on PTRDIFF_TSPEC

Since 2023.07.08.12.45.43, lint warns in lib/libkvm on i386.
 1.4 08-Jul-2023  rillig lint: warn about pointer casts between different kinds of types

Pointer casts from an integer type to a floating-point type and vice
versa get a 'maybe troublesome' warning now. The previous assumption
that all types of the same bit-size are convertible may have been valid
from a technical point of view, but still such code should get more
attention.

The rules for struct and union types could be made more fine-grained
later, if the need arises. To suppress this warning, it's always
possible to cast to an intermediate 'void *'.
 1.3 08-Jul-2023  rillig tests/lint: fix a few ilp32 tests
 1.2 05-Jul-2023  rillig tests/lint: spell platform identifiers for 'long double' consistently

The test file names don't have a hyphen, so the identifiers shouldn't
have one either.
 1.1 05-Jul-2023  rillig tests/lint: add platform-specific tests for troublesome pointer casts
 1.5.2.1 02-Aug-2025  perseant Sync with HEAD
 1.6 28-Sep-2024  rillig lint: reword warning about cast between unrelated pointer types

The phrase "may be troublesome" was too unspecific to be useful.
 1.5 07-Aug-2023  rillig branches: 1.5.2;
tests/lint: show that portable mode depends on PTRDIFF_TSPEC

Since 2023.07.08.12.45.43, lint warns in lib/libkvm on i386.
 1.4 08-Jul-2023  rillig lint: warn about pointer casts between different kinds of types

Pointer casts from an integer type to a floating-point type and vice
versa get a 'maybe troublesome' warning now. The previous assumption
that all types of the same bit-size are convertible may have been valid
from a technical point of view, but still such code should get more
attention.

The rules for struct and union types could be made more fine-grained
later, if the need arises. To suppress this warning, it's always
possible to cast to an intermediate 'void *'.
 1.3 06-Jul-2023  rillig tests/lint: ensure consistent preprocessor filenames in tests

The deviations often happen when copying or renaming tests.
 1.2 05-Jul-2023  rillig tests/lint: spell platform identifiers for 'long double' consistently

The test file names don't have a hyphen, so the identifiers shouldn't
have one either.
 1.1 05-Jul-2023  rillig tests/lint: add platform-specific tests for troublesome pointer casts
 1.5.2.1 02-Aug-2025  perseant Sync with HEAD
 1.6 28-Sep-2024  rillig lint: reword warning about cast between unrelated pointer types

The phrase "may be troublesome" was too unspecific to be useful.
 1.5 07-Aug-2023  rillig branches: 1.5.2;
tests/lint: show that portable mode depends on PTRDIFF_TSPEC

Since 2023.07.08.12.45.43, lint warns in lib/libkvm on i386.
 1.4 08-Jul-2023  rillig lint: warn about pointer casts between different kinds of types

Pointer casts from an integer type to a floating-point type and vice
versa get a 'maybe troublesome' warning now. The previous assumption
that all types of the same bit-size are convertible may have been valid
from a technical point of view, but still such code should get more
attention.

The rules for struct and union types could be made more fine-grained
later, if the need arises. To suppress this warning, it's always
possible to cast to an intermediate 'void *'.
 1.3 08-Jul-2023  rillig lint: do not use portable type sizes in integer constraints

This reverts the change from tree.c 1.547 from 2023-07-03. Back then, I
didn't know that the actual value from a type's 'portable size in bits'
was not supposed to be used.
 1.2 05-Jul-2023  rillig tests/lint: spell platform identifiers for 'long double' consistently

The test file names don't have a hyphen, so the identifiers shouldn't
have one either.
 1.1 05-Jul-2023  rillig tests/lint: add platform-specific tests for troublesome pointer casts
 1.5.2.1 02-Aug-2025  perseant Sync with HEAD
 1.2 28-Sep-2024  rillig lint: reword warning about cast between unrelated pointer types

The phrase "may be troublesome" was too unspecific to be useful.
 1.1 07-Aug-2023  rillig branches: 1.1.2;
tests/lint: show that portable mode depends on PTRDIFF_TSPEC

Since 2023.07.08.12.45.43, lint warns in lib/libkvm on i386.
 1.1.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 21-Jan-2023  rillig lint: add test for floating constant overflow
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.16 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.15 28-Jan-2024  rillig branches: 1.15.2;
tests/lint: sort multiple diagnostics per line chronologically

For now, the chronologic order is not enforced but has to be established
manually, for example by removing all 'expect' comment lines and
regenerating them with 'accept.sh -u'.

While here, clean up a few instances that came up when regenerating the
'expect' comments, such as wrong indentation or needless deviation from
the 'expect+1' form.
 1.14 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.13 29-Jan-2023  rillig lint: properly clean up when leaving a function definition
 1.12 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.11 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.10 31-May-2022  rillig lint: fix null pointer dereference after syntax error

Found by afl, starting with the malformed input '/**/f=({;/**/};}' that
no longer crashes. This input led to 'f=({L:;}', which is at least a
syntactically valid prefix of a translation unit, containing a GCC
statement expression with an unused label. The error message for this
unused label assumed that it would always be inside a function
definition.

While here, document incomplete recovery after syntax errors, in
msg_249.c.
 1.9 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.8 10-Jul-2021  rillig lint: rename clrtyp/deftyp to begin_type/end_type

The abbreviations clr/def did not make it obvious that these two
functions or grammar rules form pairs.

No functional change.
 1.7 10-Jul-2021  rillig lint: do not allow struct{const;}

In traditional C, a struct member was defined syntactically as
'type-specifier struct-declarator-list', the concept of a type-qualifier
was not known back then.

C90 invented the type-qualifier 'const' and relaxed the syntactic
requirement for struct member declarations by allowing 'const x'. Having
only a type-qualifier without an actual type may be regarded as an
"incomplete type", which would be forbidden by C90 and later.

Anyway, this doesn't occur in practice anyway, so there is no need for
lint to try to parse it. This removes a bit of dead code, since a
type-qualifier-list can never have type struct or union.
 1.6 10-Jul-2021  rillig lint: fix assertion failure for malformed member declaration
 1.5 08-Jul-2021  rillig tests/lint: test error recovery of the parser
 1.4 08-Jul-2021  rillig tests/lint: add test coverage for some parse errors
 1.3 19-Jun-2021  rillig lint: fix assertion failure after malformed statement

Found using afl.
 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
 1.10 17-Jun-2022  rillig 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'.
 1.9 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.8 31-May-2022  rillig lint: fix null pointer dereference after syntax error

Found by afl, starting with the malformed input '/**/f=({;/**/};}' that
no longer crashes. This input led to 'f=({L:;}', which is at least a
syntactically valid prefix of a translation unit, containing a GCC
statement expression with an unused label. The error message for this
unused label assumed that it would always be inside a function
definition.

While here, document incomplete recovery after syntax errors, in
msg_249.c.
 1.7 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.6 10-Jul-2021  rillig lint: do not allow struct{const;}

In traditional C, a struct member was defined syntactically as
'type-specifier struct-declarator-list', the concept of a type-qualifier
was not known back then.

C90 invented the type-qualifier 'const' and relaxed the syntactic
requirement for struct member declarations by allowing 'const x'. Having
only a type-qualifier without an actual type may be regarded as an
"incomplete type", which would be forbidden by C90 and later.

Anyway, this doesn't occur in practice anyway, so there is no need for
lint to try to parse it. This removes a bit of dead code, since a
type-qualifier-list can never have type struct or union.
 1.5 10-Jul-2021  rillig lint: fix assertion failure for malformed member declaration
 1.4 08-Jul-2021  rillig tests/lint: add test coverage for some parse errors
 1.3 19-Jun-2021  rillig lint: fix assertion failure after malformed statement

Found using afl.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 01-Oct-2022  rillig lint: add hyphen to adjective 'old-style'
 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 24-Apr-2022  rillig lint: error out on declarations with implicit int type
 1.3 29-Jun-2021  rillig tests/lint: add tests for the lexical analysis
 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.5 17-Jun-2022  rillig 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'.
 1.4 24-Apr-2022  rillig lint: error out on declarations with implicit int type
 1.3 29-Jun-2021  rillig tests/lint: add tests for the lexical analysis
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 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.3 29-Jun-2021  rillig tests/lint: add tests for the lexical analysis
 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.4 17-Jun-2022  rillig 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'.
 1.3 29-Jun-2021  rillig tests/lint: add tests for the lexical analysis
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.8 08-Jun-2024  rillig tests/lint: remove unused lint1-skip-if selector
 1.7 27-Jan-2024  rillig tests/lint: test integer constants in different language levels
 1.6 02-Jul-2023  rillig lint: rename 'quad' to 'signed int' or 'unsigned int'

No functional change.
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 28-Aug-2021  rillig tests/lint: disable test for message 252 on ILP32 platforms
 1.3 27-Aug-2021  rillig tests/lint: test some more messages
 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.5 17-Jun-2022  rillig 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'.
 1.4 28-Aug-2021  rillig tests/lint: disable test for message 252 on ILP32 platforms
 1.3 27-Aug-2021  rillig tests/lint: test some more messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 02-Feb-2024  rillig lint: make newline in a string literal an error in C90 and later
 1.4 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.3 29-Jun-2021  rillig tests/lint: add tests for the lexical analysis
 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.4 17-Jun-2022  rillig 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'.
 1.3 29-Jun-2021  rillig tests/lint: add tests for the lexical analysis
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 02-Feb-2024  rillig tests/lint: test lexing of characters and strings
 1.5 02-Feb-2024  rillig lint: fix debug output for strings, reduce code size

The debug output contained too many newlines.

The buffer functions were built into lint2 even though they weren't
used.

Enable the query for invisible characters in string literals, to make
sure that a newline in a string literal does not trigger that query.
 1.4 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.3 29-Jun-2021  rillig tests/lint: add tests for the lexical analysis
 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.4 17-Jun-2022  rillig 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'.
 1.3 29-Jun-2021  rillig tests/lint: add tests for the lexical analysis
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.7 08-Dec-2024  rillig lint: warn about do-while macros that end with a semicolon
 1.6 11-Aug-2023  rillig branches: 1.6.2;
tests/lint: test parsing of preprocessing directives
 1.5 09-Jul-2023  rillig lint: clean up the wording of a few diagnostics
 1.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.6.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.8 02-Aug-2023  rillig lint: distinguish between arguments and parameters
 1.7 09-Jul-2023  rillig lint: clean up the wording of a few diagnostics
 1.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.4 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.3 27-Aug-2021  rillig tests/lint: test some more messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 27-Aug-2021  rillig tests/lint: test some more messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.7 02-Feb-2024  rillig tests/lint: test lexing of characters and strings
 1.6 02-Feb-2024  rillig lint: make newline in a string literal an error in C90 and later
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.25 09-Jun-2024  rillig lint: warn about lossy floating point constant to integer conversions
 1.24 08-Jun-2024  rillig tests/lint: group tests by topic
 1.23 09-Jul-2023  rillig lint: remove redundant '#' after 'argument' in diagnostics
 1.22 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.21 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.20 15-Apr-2022  rillig lint: in C99 mode, do not warn about non-prototype conversions

Message 259 is "argument #%d is converted from '%s' to '%s' due to
prototype", and it is intended to warn about compatibility between
traditional C where functions had no prototypes and standard C where
functions have prototypes.

Running lint in C99 mode is further away from traditional C than running
lint in C90 mode, so that warning doesn't make sense for C99. There are
still some inconsistencies in the 5 language version modes that lint
offers:

-t for traditional C
(no option) for migrating traditional C to C90
-s for C90 code
-S for C99 code
-Ac11 for C11 code

By disabling warning 259 in C99 mode, a typical NetBSD build produces
14.500 fewer warnings than before, of about 100.000 total.

Message 259 overlaps with message 298 "conversion from '%s' to '%s' may
lose accuracy, arg #%d", and in some cases of potentially lossy
conversions, lint now produces none of these messages. In some other
cases, these warnings were reported redundantly. The cases where
message 298 makes sense will be added back later, as needed.
 1.19 02-Sep-2021  rillig lint: align tests for message 259, clarify its purpose
 1.18 02-Sep-2021  rillig lint: fix unintended warning for converting long long to signed char
 1.17 02-Sep-2021  rillig tests/lint: demonstrate unintended prototype warning for signed char
 1.16 31-Aug-2021  rillig tests/lint: add cross-references to message 297

The check for lossy integer conversions is already implemented, it's
just not activated in the default NetBSD build.
 1.15 31-Aug-2021  rillig tests/lint: add test for prototype conversions in C90

The purpose of warning 259 is to find function calls that differ in the
ABI. The warning's original purpose was not to warn about lossy
conversions, that's just a side effect.

Warning 259 had been implemented before C99 was published, which is more
than 20 years ago. In the meantime, almost all code has migrated to
using function prototypes. With the default lint flags from NetBSD's
<sys.mk>, it would rather make sense to focus on lossy conversions now.

To prepare for potentially upcoming differences in lint's C90 and C99
modes, clone the test now as far as possible. The test for C90 mode is
smaller than for C99 mode, since 'long long' was not available back
then.
 1.14 31-Aug-2021  rillig tests/lint: add missing test cases for integer conversions

While adding the missing test cases, I re-read the comments and
discarded several of them, since converting a signed value to an
unsigned type can be lossy as well, which warrants a warning.
 1.13 30-Aug-2021  rillig tests/lint: test passing sizeof(int) to parameter type 'unsigned int'

Seen in usr.sbin/inetd/inetd.c, which calls getnameinfo and passes
sizeof(buf).
 1.12 21-Aug-2021  rillig tests/lint: add more test cases for lossy integer conversion
 1.11 21-Aug-2021  rillig tests/lint: guard against typos in test environment configuration

Some tests had "lint1-only-if" without a trailing colon, others included
the trailing colon. The tests that included the trailing colon were run
even though they were supposed to be skipped, and they failed, as could
be expected.

To prevent further typos, always require the trailing colon, just as in
"lint1-flags" and fail fast on unknown "lint1" comments.
 1.10 21-Aug-2021  rillig tests/lint: add tests for conversion from signed to unsigned
 1.9 04-Jul-2021  rillig tests/lint: align tests for argument conversion to each other
 1.8 29-Jun-2021  rillig tests/lint: add test that only runs where char == unsigned char

There a 4 regular NetBSD builds where lint is activated. All these
builds run on platforms where char == signed char.

The official test runs from https://releng.netbsd.org/test-results.html
mostly have char == signed char as well.

However, lint behaves differently on platforms with char == unsigned
char. On these platforms, a simple "char ch = '\xff'" leads to the
bogus warning that "conversion of 'int' to 'char' is out of range".
 1.7 29-Jun-2021  rillig tests/lint: add tests for ILP32 platforms

Previously, all tests for lint had to produce the exact same output, no
matter which platform they ran on. This differs from practical needs
since lint is intended to produce different results depending on whether
the platform is ILP32 or LP64.

Examples for these are type conversions and the widths of the integer
types during lexical analysis.
 1.6 04-Feb-2021  rillig lint: update message text for 259 in test

That's the one place that is not checked for matching the actual message
by my usual pre-commit checks.
 1.5 04-Feb-2021  rillig lint: add back "due to prototype" to message 259

That message is only supposed to warn about compatibility to traditional
C, in case the function should ever be compiled without its prototype
being in effect. All other type checks are supposed to be in another
function, as documented, but that type check misses to report a few
error-prone type combinations (long to char, long to int).

30 years after the introduction of prototypes with C90, almost all
existing code uses prototypes. The warning has thus lost most of its
usefulness and can rather be confusing since a conversion from 'char' to
'long' is not problematic with prototypes in action, and the probability
of the code being backported to a pre-C90 compiler is diminishingly
small.

The words "due to prototype" now serve as a hint again. The proper fix
could be to suppress this warning in C99 mode since that's far enough
from traditional C.
 1.4 31-Jan-2021  rillig lint: reword message 259 about function argument conversion

The words "due to prototype" are an anachronism from the 1990s.
Nowadays every function is defined using a prototype, which makes these
words redundant.
 1.3 31-Jan-2021  rillig lint: make warning about function argument conversion more detailed

For every conversion it is useful to know both the source and the target
type since these are not always obvious from the code.

The only surprise is the warning in d_gcc_extension. The conversion
there is from 'double' to 'long double', which is a lossless conversion.
This may be a bug in lint.
 1.2 30-Jan-2021  rillig lint: add test for message 259 about implicit conversions
 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.17 17-Jun-2022  rillig 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'.
 1.16 02-Sep-2021  rillig lint: align tests for message 259, clarify its purpose
 1.15 02-Sep-2021  rillig lint: fix unintended warning for converting long long to signed char
 1.14 02-Sep-2021  rillig tests/lint: demonstrate unintended prototype warning for signed char
 1.13 31-Aug-2021  rillig tests/lint: add cross-references to message 297

The check for lossy integer conversions is already implemented, it's
just not activated in the default NetBSD build.
 1.12 31-Aug-2021  rillig tests/lint: add test for prototype conversions in C90

The purpose of warning 259 is to find function calls that differ in the
ABI. The warning's original purpose was not to warn about lossy
conversions, that's just a side effect.

Warning 259 had been implemented before C99 was published, which is more
than 20 years ago. In the meantime, almost all code has migrated to
using function prototypes. With the default lint flags from NetBSD's
<sys.mk>, it would rather make sense to focus on lossy conversions now.

To prepare for potentially upcoming differences in lint's C90 and C99
modes, clone the test now as far as possible. The test for C90 mode is
smaller than for C99 mode, since 'long long' was not available back
then.
 1.11 31-Aug-2021  rillig tests/lint: add missing test cases for integer conversions

While adding the missing test cases, I re-read the comments and
discarded several of them, since converting a signed value to an
unsigned type can be lossy as well, which warrants a warning.
 1.10 30-Aug-2021  rillig tests/lint: test passing sizeof(int) to parameter type 'unsigned int'

Seen in usr.sbin/inetd/inetd.c, which calls getnameinfo and passes
sizeof(buf).
 1.9 21-Aug-2021  rillig tests/lint: add more test cases for lossy integer conversion
 1.8 21-Aug-2021  rillig tests/lint: add tests for conversion from signed to unsigned
 1.7 04-Jul-2021  rillig tests/lint: align tests for argument conversion to each other
 1.6 29-Jun-2021  rillig tests/lint: add tests for ILP32 platforms

Previously, all tests for lint had to produce the exact same output, no
matter which platform they ran on. This differs from practical needs
since lint is intended to produce different results depending on whether
the platform is ILP32 or LP64.

Examples for these are type conversions and the widths of the integer
types during lexical analysis.
 1.5 04-Feb-2021  rillig lint: add back "due to prototype" to message 259

That message is only supposed to warn about compatibility to traditional
C, in case the function should ever be compiled without its prototype
being in effect. All other type checks are supposed to be in another
function, as documented, but that type check misses to report a few
error-prone type combinations (long to char, long to int).

30 years after the introduction of prototypes with C90, almost all
existing code uses prototypes. The warning has thus lost most of its
usefulness and can rather be confusing since a conversion from 'char' to
'long' is not problematic with prototypes in action, and the probability
of the code being backported to a pre-C90 compiler is diminishingly
small.

The words "due to prototype" now serve as a hint again. The proper fix
could be to suppress this warning in C99 mode since that's far enough
from traditional C.
 1.4 31-Jan-2021  rillig lint: reword message 259 about function argument conversion

The words "due to prototype" are an anachronism from the 1990s.
Nowadays every function is defined using a prototype, which makes these
words redundant.
 1.3 31-Jan-2021  rillig lint: make warning about function argument conversion more detailed

For every conversion it is useful to know both the source and the target
type since these are not always obvious from the code.

The only surprise is the warning in d_gcc_extension. The conversion
there is from 'double' to 'long double', which is a lossless conversion.
This may be a bug in lint.
 1.2 30-Jan-2021  rillig lint: add test for message 259 about implicit conversions
 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.6 09-Jul-2023  rillig lint: remove redundant '#' after 'argument' in diagnostics
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 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.3 02-Sep-2021  rillig lint: align tests for message 259, clarify its purpose
 1.2 31-Aug-2021  rillig tests/lint: add cross-references to message 297

The check for lossy integer conversions is already implemented, it's
just not activated in the default NetBSD build.
 1.1 31-Aug-2021  rillig tests/lint: add test for prototype conversions in C90

The purpose of warning 259 is to find function calls that differ in the
ABI. The warning's original purpose was not to warn about lossy
conversions, that's just a side effect.

Warning 259 had been implemented before C99 was published, which is more
than 20 years ago. In the meantime, almost all code has migrated to
using function prototypes. With the default lint flags from NetBSD's
<sys.mk>, it would rather make sense to focus on lossy conversions now.

To prepare for potentially upcoming differences in lint's C90 and C99
modes, clone the test now as far as possible. The test for C90 mode is
smaller than for C99 mode, since 'long long' was not available back
then.
 1.4 17-Jun-2022  rillig 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'.
 1.3 02-Sep-2021  rillig lint: align tests for message 259, clarify its purpose
 1.2 31-Aug-2021  rillig tests/lint: add cross-references to message 297

The check for lossy integer conversions is already implemented, it's
just not activated in the default NetBSD build.
 1.1 31-Aug-2021  rillig tests/lint: add test for prototype conversions in C90

The purpose of warning 259 is to find function calls that differ in the
ABI. The warning's original purpose was not to warn about lossy
conversions, that's just a side effect.

Warning 259 had been implemented before C99 was published, which is more
than 20 years ago. In the meantime, almost all code has migrated to
using function prototypes. With the default lint flags from NetBSD's
<sys.mk>, it would rather make sense to focus on lossy conversions now.

To prepare for potentially upcoming differences in lint's C90 and C99
modes, clone the test now as far as possible. The test for C90 mode is
smaller than for C99 mode, since 'long long' was not available back
then.
 1.10 09-Jul-2023  rillig lint: remove redundant '#' after 'argument' in diagnostics
 1.9 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.8 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.7 16-Apr-2022  rillig tests/lint: fix tests on platforms other than x86_64

In msg_259_ilp32.c 1.6 from 2022-04-15, I removed the option -S from the
test in order to keep the message 259, but I forgot to fix the C99-style
comment as well.

In platform_int.c, the default lint option -S no longer generated
warning 259, so remove that option.
 1.6 15-Apr-2022  rillig lint: in C99 mode, do not warn about non-prototype conversions

Message 259 is "argument #%d is converted from '%s' to '%s' due to
prototype", and it is intended to warn about compatibility between
traditional C where functions had no prototypes and standard C where
functions have prototypes.

Running lint in C99 mode is further away from traditional C than running
lint in C90 mode, so that warning doesn't make sense for C99. There are
still some inconsistencies in the 5 language version modes that lint
offers:

-t for traditional C
(no option) for migrating traditional C to C90
-s for C90 code
-S for C99 code
-Ac11 for C11 code

By disabling warning 259 in C99 mode, a typical NetBSD build produces
14.500 fewer warnings than before, of about 100.000 total.

Message 259 overlaps with message 298 "conversion from '%s' to '%s' may
lose accuracy, arg #%d", and in some cases of potentially lossy
conversions, lint now produces none of these messages. In some other
cases, these warnings were reported redundantly. The cases where
message 298 makes sense will be added back later, as needed.
 1.5 02-Sep-2021  rillig lint: align tests for message 259, clarify its purpose
 1.4 31-Aug-2021  rillig tests/lint: add cross-references to message 297

The check for lossy integer conversions is already implemented, it's
just not activated in the default NetBSD build.
 1.3 21-Aug-2021  rillig tests/lint: guard against typos in test environment configuration

Some tests had "lint1-only-if" without a trailing colon, others included
the trailing colon. The tests that included the trailing colon were run
even though they were supposed to be skipped, and they failed, as could
be expected.

To prevent further typos, always require the trailing colon, just as in
"lint1-flags" and fail fast on unknown "lint1" comments.
 1.2 29-Jun-2021  rillig tests/lint: add test that only runs where char == unsigned char

There a 4 regular NetBSD builds where lint is activated. All these
builds run on platforms where char == signed char.

The official test runs from https://releng.netbsd.org/test-results.html
mostly have char == signed char as well.

However, lint behaves differently on platforms with char == unsigned
char. On these platforms, a simple "char ch = '\xff'" leads to the
bogus warning that "conversion of 'int' to 'char' is out of range".
 1.1 29-Jun-2021  rillig tests/lint: add tests for ILP32 platforms

Previously, all tests for lint had to produce the exact same output, no
matter which platform they ran on. This differs from practical needs
since lint is intended to produce different results depending on whether
the platform is ILP32 or LP64.

Examples for these are type conversions and the widths of the integer
types during lexical analysis.
 1.4 17-Jun-2022  rillig 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'.
 1.3 02-Sep-2021  rillig lint: align tests for message 259, clarify its purpose
 1.2 31-Aug-2021  rillig tests/lint: add cross-references to message 297

The check for lossy integer conversions is already implemented, it's
just not activated in the default NetBSD build.
 1.1 29-Jun-2021  rillig tests/lint: add tests for ILP32 platforms

Previously, all tests for lint had to produce the exact same output, no
matter which platform they ran on. This differs from practical needs
since lint is intended to produce different results depending on whether
the platform is ILP32 or LP64.

Examples for these are type conversions and the widths of the integer
types during lexical analysis.
 1.5 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.4 16-Aug-2021  rillig lint: add more details to message about redeclared tag
 1.3 18-Apr-2021  rillig lint: document wrong location information in diagnostics
 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.6 17-Jun-2022  rillig 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'.
 1.5 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.4 16-Aug-2021  rillig lint: add more details to message about redeclared tag
 1.3 18-Apr-2021  rillig lint: document wrong location information in diagnostics
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 07-Jul-2023  rillig 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.5 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 11-Jun-2022  rillig tests/lint: add test for 'previous definition' message
 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.5 17-Jun-2022  rillig 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'.
 1.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 11-Jun-2022  rillig tests/lint: add test for 'previous definition' message
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 12-Apr-2025  rillig lint: reword messages that apply to traditional C
 1.5 28-Mar-2023  rillig branches: 1.5.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.3 29-Jun-2021  rillig tests/lint: add tests for the lexical analysis
 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.5.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.3 29-Jun-2021  rillig tests/lint: add tests for the lexical analysis
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.7 12-Apr-2025  rillig lint: reword messages that apply to traditional C
 1.6 02-Feb-2024  rillig branches: 1.6.2;
tests/lint: test lexing of characters and strings
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.3 29-Jun-2021  rillig tests/lint: add tests for the lexical analysis
 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.6.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.3 29-Jun-2021  rillig tests/lint: add tests for the lexical analysis
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 12-Apr-2025  rillig lint: reword messages that apply to traditional C
 1.5 02-Feb-2024  rillig branches: 1.5.2;
tests/lint: test lexing of characters and strings
 1.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.5.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 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 22-Dec-2021  rillig lint: use C90 instead of C89 when referring to the C standard
 1.3 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.2 03-Jan-2021  rillig lint: add test for 265 "c89 C does not support 'long long'"
 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.4 17-Jun-2022  rillig 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'.
 1.3 22-Dec-2021  rillig lint: use C90 instead of C89 when referring to the C standard
 1.2 03-Jan-2021  rillig lint: add test for 265 "c89 C does not support 'long long'"
 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.6 12-Apr-2025  rillig lint: reword messages that apply to traditional C
 1.5 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.4 28-Mar-2023  rillig branches: 1.4.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.4.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.11 14-Sep-2025  rillig lint: do not preserve bit-field information in integer promotions

The bit-field information was wrongly added back in 2021. At that time,
the integer constraints had not been implemented yet, so it was a
straight-forward idea to implement value restrictions using the type
system and propagage these through the expressions.

Due to preserving the bit-field information, some lint warnings
contained wrong type information. These warnings are now fixed.
 1.10 14-Sep-2025  rillig lint: add more type details to several messages

In most expressions, the integer promotions are performed on the
operands, making the actual type different from the "visible" type of an
operand. To properly explain the situation, mention the type before the
integer promotions in case it differs from the resulting type.
 1.9 20-Feb-2025  rillig lint: support __attribute__((__mode__(TI)))

This fixes the wrong lint warnings about the shift amount being greater
than the type size in compiler_rt/popcountti2.c.
 1.8 12-Mar-2024  rillig branches: 1.8.2;
lint: fix warning about loss of conversion for unsigned bit-fields

Since decl.c 1.180 from 2021-05-02.
 1.7 07-Jul-2023  rillig 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 19-Aug-2022  rillig lint: add more details to message about large bit-shifts
 1.5 19-Aug-2022  rillig tests/lint: demonstrate wrong warning about bit-shift
 1.4 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.3 09-Apr-2021  rillig tests/lint: test bit-shift amount equal to the type's width
 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.8.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.3 09-Apr-2021  rillig tests/lint: test bit-shift amount equal to the type's width
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 07-Jul-2023  rillig 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.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 22-Aug-2021  rillig tests/lint: test messages 268 to 274
 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.5 17-Jun-2022  rillig 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'.
 1.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 22-Aug-2021  rillig tests/lint: test messages 268 to 274
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 09-Jul-2023  rillig lint: clean up wording in diagnostics

Use the term 'parameter' as defined in C99 3.15.
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 22-Aug-2021  rillig tests/lint: test messages 268 to 274
 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.5 17-Jun-2022  rillig 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'.
 1.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 22-Aug-2021  rillig tests/lint: test messages 268 to 274
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 12-Apr-2025  rillig lint: reword messages that apply to traditional C
 1.5 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.4 28-Mar-2023  rillig branches: 1.4.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 22-Aug-2021  rillig tests/lint: test messages 268 to 274
 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.4.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 22-Aug-2021  rillig tests/lint: test messages 268 to 274
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 22-Aug-2021  rillig lint: use standard quotes in messages 203 and 271
 1.3 22-Aug-2021  rillig tests/lint: test messages 268 to 274
 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.5 17-Jun-2022  rillig 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'.
 1.4 22-Aug-2021  rillig lint: use standard quotes in messages 203 and 271
 1.3 22-Aug-2021  rillig tests/lint: test messages 268 to 274
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.3 22-Aug-2021  rillig tests/lint: test messages 268 to 274
 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.4 17-Jun-2022  rillig 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'.
 1.3 22-Aug-2021  rillig tests/lint: test messages 268 to 274
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.1 08-Jul-2021  rillig tests/lint: add tests for C90 mode and malformed declarations

In the grammar, 148 lines are still uncovered by the tests. The
untested parts are mostly obscure declarations and a few parse errors.
 1.2 17-Jun-2022  rillig 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'.
 1.1 08-Jul-2021  rillig tests/lint: add tests for C90 mode and malformed declarations

In the grammar, 148 lines are still uncovered by the tests. The
untested parts are mostly obscure declarations and a few parse errors.
 1.4 26-Aug-2023  rillig lint: make diagnostics about ANSI C more international
 1.3 22-Aug-2021  rillig tests/lint: test messages 268 to 274
 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.4 17-Jun-2022  rillig 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'.
 1.3 22-Aug-2021  rillig tests/lint: test messages 268 to 274
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 26-Aug-2023  rillig lint: make diagnostics about ANSI C more international
 1.4 07-Jul-2023  rillig 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.3 22-Aug-2021  rillig tests/lint: test messages 268 to 274
 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.4 17-Jun-2022  rillig 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'.
 1.3 22-Aug-2021  rillig tests/lint: test messages 268 to 274
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 07-Jul-2023  rillig 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.5 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.4 28-Feb-2021  rillig tests/lint: keep messages in test files in sync with actual messages

Each of the tests named msg_*.c repeats the template of the message, to
make the test somewhat self-contained when viewed in isolation.

This creates a redundancy, and keeping track of this manually is next to
impossible. I tried it and failed in 9 cases, even though it has just
been 2 months since I myself created the initial files and I knew all
the time that this redundancy exists.

Be fool-proof for the future by checking this automatically.
 1.3 28-Feb-2021  rillig tests/lint: add test for unconst pointer cast
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 28-Feb-2021  rillig tests/lint: add test for unconst pointer cast
 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.6 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.5 28-Mar-2023  rillig branches: 1.5.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.5.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.9 28-Jan-2024  rillig tests/lint: sort multiple diagnostics per line chronologically

For now, the chronologic order is not enforced but has to be established
manually, for example by removing all 'expect' comment lines and
regenerating them with 'accept.sh -u'.

While here, clean up a few instances that came up when regenerating the
'expect' comments, such as wrong indentation or needless deviation from
the 'expect+1' form.
 1.8 07-Jul-2023  rillig lint: only skip 'unused' warnings after errors, not other warnings

Previously, in -w mode, any warning suppressed further 'unused'
warnings, even though there was no need to do that. This can be seen in
the test gcc_attribute_var.c, where only the last unused variable from a
function was marked as unused, the others slipped through.

Fixed by counting the errors and the warnings separately and only
combining them if actually desired.
 1.7 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.6 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.5 16-Aug-2021  rillig tests/lint: test arithmetic promotions and enums
 1.4 27-Feb-2021  rillig tests/lint: add tests for enum/int mismatch
 1.3 22-Feb-2021  rillig lint: change spelling of initialisation to initialization

That's the wording from the ISO C99 standard.
 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.5 17-Jun-2022  rillig 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'.
 1.4 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.3 16-Aug-2021  rillig tests/lint: test arithmetic promotions and enums
 1.2 27-Feb-2021  rillig tests/lint: add tests for enum/int mismatch
 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.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.3 27-Feb-2021  rillig tests/lint: add tests for enum/int mismatch
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 27-Feb-2021  rillig tests/lint: add tests for enum/int mismatch
 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.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.3 27-Feb-2021  rillig tests/lint: add tests for enum/int mismatch
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 27-Feb-2021  rillig tests/lint: add tests for enum/int mismatch
 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.9 02-Aug-2023  rillig lint: distinguish between arguments and parameters
 1.8 09-Jul-2023  rillig lint: clean up wording in diagnostics

Use the term 'parameter' as defined in C99 3.15.
 1.7 07-Jul-2023  rillig 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 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.5 05-Sep-2021  rillig tests/lint: document placement of lint comments
 1.4 05-Sep-2021  rillig tests/lint: clean up test for misplaced lint comments

A varargs comment that appears in the function body is already covered
by varargs_bad_body. Cleaning up this test makes sure that the warning
is indeed triggered by the comment in the parameters declaration.
 1.3 30-Aug-2021  rillig tests/lint: test varargs, printflike, scanflike
 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.6 17-Jun-2022  rillig 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'.
 1.5 05-Sep-2021  rillig tests/lint: document placement of lint comments
 1.4 05-Sep-2021  rillig tests/lint: clean up test for misplaced lint comments

A varargs comment that appears in the function body is already covered
by varargs_bad_body. Cleaning up this test makes sure that the warning
is indeed triggered by the comment in the parameters declaration.
 1.3 30-Aug-2021  rillig tests/lint: test varargs, printflike, scanflike
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 07-Jul-2023  rillig 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.4 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.8 02-Aug-2023  rillig lint: distinguish between arguments and parameters
 1.7 09-Jul-2023  rillig lint: clean up the wording of a few diagnostics
 1.6 07-Jul-2023  rillig 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.5 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.4 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.3 30-Aug-2021  rillig tests/lint: test varargs, printflike, scanflike
 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.4 17-Jun-2022  rillig 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'.
 1.3 30-Aug-2021  rillig tests/lint: test varargs, printflike, scanflike
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.7 03-Jan-2025  rillig lint: add detail to message about obsolete identifier list
 1.6 01-Dec-2024  rillig lint: warn about function definitions that still use identifier lists
 1.5 28-Mar-2023  rillig branches: 1.5.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.3 15-Jun-2021  rillig tests/lint: add test for previous prototype declaration
 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.5.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.3 15-Jun-2021  rillig tests/lint: add test for previous prototype declaration
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 10-Mar-2025  rillig lint: in C99 mode and later, warn about non-prototype functions

Suggested by Christos Zoulas.
 1.3 16-Jun-2022  rillig branches: 1.3.4;
tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.3.4.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 10-Mar-2025  rillig lint: in C99 mode and later, warn about non-prototype functions

Suggested by Christos Zoulas.
 1.3 16-Jun-2022  rillig branches: 1.3.4;
tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.3.4.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 07-Jul-2023  rillig 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.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 09-Jul-2023  rillig lint: clean up the wording of a few diagnostics
 1.5 07-Jul-2023  rillig 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.4 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.3 27-Aug-2021  rillig tests/lint: test some more messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 27-Aug-2021  rillig tests/lint: test some more messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 07-Jul-2023  rillig 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.4 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 27-Feb-2022  rillig lint: concatenate string literals from left to right

Previously, the string literals "1" "2" "3" "4" were concatenated in the
order "23", "234", "1234". This influenced the location of the
diagnostics for traditional C (which doesn't know concatenation at all)
and for mixing regular strings and wide strings.

Now the diagnostics occur exactly where they are expected. The first
string literal defines whether the whole string is regular or wide, and
any further string literals must match it.

In traditional C mode, there are more diagnostics than before, but that
doesn't hurt since they are still correct and nobody uses lint in
traditional C mode anyway.
 1.3 27-Feb-2022  rillig tests/lint: demonstrate unexpected ordering of string concatenations

When lint concatenates the strings "1" "2" "3" "4", it first
concatenates "23", then "234" and finally "1234".
 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.5 17-Jun-2022  rillig 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'.
 1.4 27-Feb-2022  rillig lint: concatenate string literals from left to right

Previously, the string literals "1" "2" "3" "4" were concatenated in the
order "23", "234", "1234". This influenced the location of the
diagnostics for traditional C (which doesn't know concatenation at all)
and for mixing regular strings and wide strings.

Now the diagnostics occur exactly where they are expected. The first
string literal defines whether the whole string is regular or wide, and
any further string literals must match it.

In traditional C mode, there are more diagnostics than before, but that
doesn't hurt since they are still correct and nobody uses lint in
traditional C mode anyway.
 1.3 27-Feb-2022  rillig tests/lint: demonstrate unexpected ordering of string concatenations

When lint concatenates the strings "1" "2" "3" "4", it first
concatenates "23", then "234" and finally "1234".
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 02-Aug-2023  rillig lint: distinguish between arguments and parameters
 1.5 09-Jul-2023  rillig lint: clean up wording in diagnostics

Use the term 'parameter' as defined in C99 3.15.
 1.4 07-Jul-2023  rillig 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.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 08-Jun-2024  rillig lint: add details to warnings about negative constant to unsigned
 1.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 27-Aug-2021  rillig tests/lint: test some more messages
 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.4 17-Jun-2022  rillig 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'.
 1.3 27-Aug-2021  rillig tests/lint: test some more messages
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.8 27-Feb-2025  rillig lint: fix integer overflow when multiplying two large signed numbers

Seen in ipsec-tools/crypto_openssl.c.
 1.7 09-Jun-2024  rillig branches: 1.7.2;
lint: warn about lossy floating point constant to integer conversions
 1.6 08-Jun-2024  rillig tests/lint: group tests by topic
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 19-Apr-2022  rillig lint: do not warn about converting (1234567L & 0xFF) to unsigned char

Due to the '& 0xFF', there is no possible loss of accuracy.
 1.3 19-Apr-2022  rillig tests/lint: demonstrate wrong warnings for conversion from long to char
 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.7.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2022  rillig 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'.
 1.4 19-Apr-2022  rillig lint: do not warn about converting (1234567L & 0xFF) to unsigned char

Due to the '& 0xFF', there is no possible loss of accuracy.
 1.3 19-Apr-2022  rillig tests/lint: demonstrate wrong warnings for conversion from long to char
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 07-Jul-2023  rillig 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.4 01-Oct-2022  rillig lint: add hyphen to adjective 'old-style'
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Jun-2022  rillig tests/lint: add more details to messages in msg_200 until msg_299

Add some tests that were previously empty. Some other tests are still
empty.
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 07-Jul-2023  rillig 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.4 01-Oct-2022  rillig lint: add hyphen to adjective 'old-style'
 1.3 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 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.4 17-Jun-2022  rillig 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'.
 1.3 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 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.4 17-Jun-2022  rillig 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'.
 1.3 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.8 07-Jul-2023  rillig 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.7 15-Apr-2023  rillig tests/lint: remove wrong comment

GCC 10 does warn about returning a temporary object, but only when
optimizations are enabled.
 1.6 15-Apr-2023  rillig tests/lint: add more tests for returning local objects
 1.5 15-Apr-2023  rillig tests/lint: extend test for returning local address
 1.4 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.3 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 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.4 17-Jun-2022  rillig 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'.
 1.3 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 26-Aug-2023  rillig lint: make diagnostics about ANSI C more international
 1.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 16-Aug-2021  rillig tests/lint: add tests for several messages about type mismatch
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Aug-2021  rillig tests/lint: add tests for several messages about type mismatch
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 26-Aug-2023  rillig lint: make diagnostics about ANSI C more international
 1.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 16-Aug-2021  rillig tests/lint: add tests for several messages about type mismatch
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Aug-2021  rillig tests/lint: add tests for several messages about type mismatch
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 07-Jan-2024  rillig tests/lint: test operators, integer overflow, conversions
 1.5 26-Aug-2023  rillig lint: make diagnostics about ANSI C more international
 1.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 16-Aug-2021  rillig tests/lint: add tests for several messages about type mismatch
 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.4 17-Jun-2022  rillig 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'.
 1.3 16-Aug-2021  rillig tests/lint: add tests for several messages about type mismatch
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 20-Feb-2025  rillig lint: add detail to message about truncated constant
 1.5 07-Jul-2023  rillig branches: 1.5.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.4 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.3 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 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.5.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 07-Jul-2023  rillig 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.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 11-Jun-2022  rillig tests/lint: add tests for messages that lack quotes
 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.5 17-Jun-2022  rillig 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'.
 1.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 11-Jun-2022  rillig tests/lint: add tests for messages that lack quotes
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.9 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.8 28-Mar-2023  rillig branches: 1.8.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.7 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.6 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.5 28-Feb-2021  rillig tests/lint: keep messages in test files in sync with actual messages

Each of the tests named msg_*.c repeats the template of the message, to
make the test somewhat self-contained when viewed in isolation.

This creates a redundancy, and keeping track of this manually is next to
impossible. I tried it and failed in 9 cases, even though it has just
been 2 months since I myself created the initial files and I knew all
the time that this redundancy exists.

Be fool-proof for the future by checking this automatically.
 1.4 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.3 02-Jan-2021  rillig lint: fix message 308 "Invalid type for _Complex"

Previously, lint aborted since it didn't expect tspec_name to be called
with NOTSPEC, which at that point was the only possible value of
dcs->d_cmod.
 1.2 02-Jan-2021  rillig lint: add test for message 308 "Invalid type %s for _Complex"
 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.8.2.1 02-Aug-2025  perseant Sync with HEAD
 1.7 17-Jun-2022  rillig 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'.
 1.6 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.5 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.4 03-Jan-2021  rillig lint: fix spelling of message 308

All other messages are lowercase as well.
 1.3 02-Jan-2021  rillig lint: fix message 308 "Invalid type for _Complex"

Previously, lint aborted since it didn't expect tspec_name to be called
with NOTSPEC, which at that point was the only possible value of
dcs->d_cmod.
 1.2 02-Jan-2021  rillig lint: add test for message 308 "Invalid type %s for _Complex"
 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.9 08-Jul-2025  rillig lint: reword message about 'extra bits set to 0'

The word 'extra' in the previous wording was too unspecific to make
sense of. In the reworded message, focus on the problem instead of
mentioning only the effect.
 1.8 24-Feb-2025  rillig tests/lint: add tests for constants, pointers and lost bits
 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 15-Oct-2022  rillig tests/lint: add more examples for 'extra bits set to 0'

Seen in sys/external/bsd/compiler_rt/dist/lib/builtins/fp_lib.h:88.
 1.5 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.4 16-May-2021  rillig lint: add quotes to message 309 about constant conversion
 1.3 16-May-2021  rillig tests/lint: add test for warning about zero-bits in '&'
 1.2 21-Feb-2021  rillig branches: 1.2.2;
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.2.2.1 31-May-2021  cjep sync with head
 1.7.2.1 02-Aug-2025  perseant Sync with HEAD
 1.6 17-Jun-2022  rillig 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'.
 1.5 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.4 16-May-2021  rillig lint: add quotes to message 309 about constant conversion
 1.3 16-May-2021  rillig tests/lint: add test for warning about zero-bits in '&'
 1.2 21-Mar-2021  rillig branches: 1.2.2;
lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.2.2.1 31-May-2021  cjep sync with head
 1.6 02-Aug-2023  rillig lint: distinguish between arguments and parameters
 1.5 09-Jul-2023  rillig lint: clean up wording in diagnostics

Use the term 'parameter' as defined in C99 3.15.
 1.4 07-Jul-2023  rillig 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.3 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 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.4 17-Jun-2022  rillig 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'.
 1.3 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 07-Jul-2023  rillig 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.3 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 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.4 17-Jun-2022  rillig 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'.
 1.3 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 09-Jul-2023  rillig lint: clean up the wording of a few diagnostics
 1.4 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.3 22-Dec-2021  rillig lint: use C90 instead of C89 when referring to the C standard
 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.4 17-Jun-2022  rillig 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'.
 1.3 22-Dec-2021  rillig lint: use C90 instead of C89 when referring to the C standard
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 27-Feb-2022  rillig tests/lint: add tests for messages referring to C99
 1.3 27-Feb-2022  rillig lint: C99 has been released, so refer to it by its proper name
 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.4 17-Jun-2022  rillig 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'.
 1.3 27-Feb-2022  rillig tests/lint: add tests for messages referring to C99
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 07-Jul-2023  rillig 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.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 11-Jun-2022  rillig tests/lint: add tests for messages that lack quotes
 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.4 17-Jun-2022  rillig 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'.
 1.3 11-Jun-2022  rillig tests/lint: add tests for messages that lack quotes
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 27-Feb-2022  rillig tests/lint: add tests for messages referring to C99
 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.4 17-Jun-2022  rillig 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'.
 1.3 27-Feb-2022  rillig tests/lint: add tests for messages referring to C99
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 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.4 17-Jun-2022  rillig 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'.
 1.3 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 07-Jul-2023  rillig 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.4 27-Feb-2022  rillig tests/lint: add tests for messages referring to C99
 1.3 27-Feb-2022  rillig lint: C99 has been released, so refer to it by its proper name
 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.4 17-Jun-2022  rillig 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'.
 1.3 27-Feb-2022  rillig tests/lint: add tests for messages referring to C99
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 07-Jul-2023  rillig 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.3 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 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.4 17-Jun-2022  rillig 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'.
 1.3 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.6 21-Jul-2023  rillig lint: reword message about non-constant initializer
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 27-Feb-2022  rillig tests/lint: add tests for messages referring to C99
 1.3 27-Feb-2022  rillig lint: C99 has been released, so refer to it by its proper name
 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.4 17-Jun-2022  rillig 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'.
 1.3 27-Feb-2022  rillig tests/lint: add tests for messages referring to C99
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 09-Jul-2023  rillig lint: clean up the wording of a few diagnostics
 1.4 07-Jul-2023  rillig 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.3 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 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.4 17-Jun-2022  rillig 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'.
 1.3 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 27-Feb-2022  rillig tests/lint: add tests for messages referring to C99
 1.3 27-Feb-2022  rillig lint: C99 has been released, so refer to it by its proper name
 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.4 17-Jun-2022  rillig 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'.
 1.3 27-Feb-2022  rillig tests/lint: add tests for messages referring to C99
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.4 14-Sep-2023  rillig lint: fix wording of diagnostics about 'C99 extension'

The term 'extension' means an extension to a C standard. C99 by itself
is not an extension but a revision of the C standard.
 1.3 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 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.4 17-Jun-2022  rillig 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'.
 1.3 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 10-Oct-2021  rillig tests/lint: add more examples for continue in do-while-0
 1.3 09-Oct-2021  rillig tests/lint: add examples for bogus warning 160 and for error 323
 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.5 17-Jun-2022  rillig 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'.
 1.4 10-Oct-2021  rillig tests/lint: add more examples for continue in do-while-0
 1.3 09-Oct-2021  rillig tests/lint: add examples for bogus warning 160 and for error 323
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.10 28-Jan-2024  rillig tests/lint: sort multiple diagnostics per line chronologically

For now, the chronologic order is not enforced but has to be established
manually, for example by removing all 'expect' comment lines and
regenerating them with 'accept.sh -u'.

While here, clean up a few instances that came up when regenerating the
'expect' comments, such as wrong indentation or needless deviation from
the 'expect+1' form.
 1.9 07-Jul-2023  rillig 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.8 07-Jul-2023  rillig lint: only skip 'unused' warnings after errors, not other warnings

Previously, in -w mode, any warning suppressed further 'unused'
warnings, even though there was no need to do that. This can be seen in
the test gcc_attribute_var.c, where only the last unused variable from a
function was marked as unused, the others slipped through.

Fixed by counting the errors and the warnings separately and only
combining them if actually desired.
 1.7 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.6 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.5 31-Jan-2021  rillig lint: add expections to tests

msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
 1.4 06-Jan-2021  rillig lint: fix test for message 324 on i386

i386 is an ILP32 platform (arch/i386/targparam.h). On these platforms,
int and long have the same size, and even with the -p option for
portability checks, INT_RSIZE in inittyp.c is defined to 4, not 3.

Because of this, in check_integer_conversion, psize(nt) was not greater
than psize(ot), and the warning was not issued.

To make the test behave the same on all platforms, changed the long
variables to long long, since long long is 64-bit on all platforms, and
int is 32-bit.
 1.3 05-Jan-2021  rillig lint: remove redundant symbolic operator names

These symbolic names for INCBEF, INCAFT, DECBEF and DECAFT were
non-standard and thus confusing. All other operators were as expected.
Now that the operator names from ops.def are very similar, there is no
need to keep to almost identical lists around.

No change to the user-visible messages since the only place where these
operator names were used was in 324, and that message was restricted to
PLUS, MINUS, MULT and SHL.
 1.2 05-Jan-2021  rillig lint: add test for "suggest cast" [324]

This warning is the only one that calls print_tnode, which in turn uses
the redundant operator names in str_op_t.

There is another list of operator names in ops.c, but those names
include more clutter, for example "p + p" instead of a simple "+".
Using those operator names would therefore rather be confusing. These
two lists should be merged, to remove unnecessary redundancy.
 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.5 17-Jun-2022  rillig 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'.
 1.4 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.3 06-Jan-2021  rillig lint: fix test for message 324 on i386

i386 is an ILP32 platform (arch/i386/targparam.h). On these platforms,
int and long have the same size, and even with the -p option for
portability checks, INT_RSIZE in inittyp.c is defined to 4, not 3.

Because of this, in check_integer_conversion, psize(nt) was not greater
than psize(ot), and the warning was not issued.

To make the test behave the same on all platforms, changed the long
variables to long long, since long long is 64-bit on all platforms, and
int is 32-bit.
 1.2 05-Jan-2021  rillig lint: add test for "suggest cast" [324]

This warning is the only one that calls print_tnode, which in turn uses
the redundant operator names in str_op_t.

There is another list of operator names in ops.c, but those names
include more clutter, for example "p + p" instead of a simple "+".
Using those operator names would therefore rather be confusing. These
two lists should be merged, to remove unnecessary redundancy.
 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.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 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.4 17-Jun-2022  rillig 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'.
 1.3 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.3 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 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.4 17-Jun-2022  rillig 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'.
 1.3 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.8 07-Jul-2023  rillig lint: only skip 'unused' warnings after errors, not other warnings

Previously, in -w mode, any warning suppressed further 'unused'
warnings, even though there was no need to do that. This can be seen in
the test gcc_attribute_var.c, where only the last unused variable from a
function was marked as unused, the others slipped through.

Fixed by counting the errors and the warnings separately and only
combining them if actually desired.
 1.7 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.6 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.5 20-Mar-2021  rillig lint: fix check for declaration after statement in pre-C99 mode

The new code may not be the most beautiful, but it fixes all bugs that
occurred while testing message 327. The grammar rules are taken from
C99 6.8.2, so it's no surprise they work well.
 1.4 20-Mar-2021  rillig lint: properly name C99 in message about declaration after statement

Now that C99 has been released and published, there is no reason anymore
to refer to it as C9X.
 1.3 20-Mar-2021  rillig tests/lint: add test for declaration after statement
 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.6 17-Jun-2022  rillig 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'.
 1.5 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.4 20-Mar-2021  rillig lint: fix check for declaration after statement in pre-C99 mode

The new code may not be the most beautiful, but it fixes all bugs that
occurred while testing message 327. The grammar rules are taken from
C99 6.8.2, so it's no surprise they work well.
 1.3 20-Mar-2021  rillig lint: properly name C99 in message about declaration after statement

Now that C99 has been released and published, there is no reason anymore
to refer to it as C9X.
 1.2 20-Mar-2021  rillig tests/lint: add test for declaration after statement
 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.4 07-Jul-2023  rillig 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.3 03-Aug-2021  rillig lint: union casts are only available as a GCC extension, not in C99
 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.4 17-Jun-2022  rillig 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'.
 1.3 03-Aug-2021  rillig lint: union casts are only available as a GCC extension, not in C99
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 07-Jul-2023  rillig 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.4 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.3 03-Aug-2021  rillig lint: union casts are only available as a GCC extension, not in C99
 1.2 24-Jan-2021  rillig lint: add test for message 329, union cast with incompatible type
 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.6 17-Jun-2022  rillig 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'.
 1.5 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.4 03-Aug-2021  rillig lint: union casts are only available as a GCC extension, not in C99
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.2 24-Jan-2021  rillig lint: add test for message 329, union cast with incompatible type
 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.8 02-Aug-2023  rillig lint: distinguish between arguments and parameters
 1.7 09-Jul-2023  rillig lint: remove redundant '#' after 'argument' in diagnostics
 1.6 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.5 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.4 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.3 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.2 16-Jan-2021  rillig lint: normalize whitespace in tests
 1.1 14-Jan-2021  rillig lint: add tests for newly added messages for strict bool mode
 1.5 17-Jun-2022  rillig 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'.
 1.4 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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 02-Aug-2023  rillig lint: distinguish between arguments and parameters
 1.6 09-Jul-2023  rillig lint: remove redundant '#' after 'argument' in diagnostics
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.3 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 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.5 17-Jun-2022  rillig 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'.
 1.4 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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 02-Aug-2023  rillig lint: distinguish between arguments and parameters
 1.6 09-Jul-2023  rillig lint: remove redundant '#' after 'argument' in diagnostics
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.3 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 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.5 17-Jun-2022  rillig 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'.
 1.4 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.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
 1.6 17-Jun-2022  rillig 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'.
 1.5 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.4 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.5 02-Aug-2023  rillig lint: distinguish between arguments and parameters
 1.4 09-Jul-2023  rillig lint: remove redundant '#' after 'argument' in diagnostics
 1.3 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.2 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.1 14-Jan-2021  rillig lint: add tests for newly added messages for strict bool mode
 1.4 17-Jun-2022  rillig 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'.
 1.3 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.1 14-Jan-2021  rillig lint: add tests for newly added messages for strict bool mode
 1.3 07-Jul-2023  rillig 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.2 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.1 14-Jan-2021  rillig lint: add tests for newly added messages for strict bool mode
 1.4 17-Jun-2022  rillig 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'.
 1.3 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.1 14-Jan-2021  rillig lint: add tests for newly added messages for strict bool mode
 1.7 02-Aug-2023  rillig lint: distinguish between arguments and parameters
 1.6 09-Jul-2023  rillig lint: remove redundant '#' after 'argument' in diagnostics
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.3 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 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.5 17-Jun-2022  rillig 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'.
 1.4 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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 02-Aug-2023  rillig lint: distinguish between arguments and parameters
 1.6 09-Jul-2023  rillig lint: remove redundant '#' after 'argument' in diagnostics
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.3 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 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.5 17-Jun-2022  rillig 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'.
 1.4 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.3 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 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.10 27-Feb-2025  rillig lint: allow the getopt warning to be suppressed in the natural place
 1.9 28-Mar-2023  rillig branches: 1.9.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.8 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.7 09-Oct-2021  rillig lint: warn if a getopt switch tries to handle unreachable ':'
 1.6 09-Oct-2021  rillig tests/lint: test getopt with an options string starting with ':'
 1.5 22-Aug-2021  rillig lint: fix wrong warning about '?' in getopt
 1.4 22-Aug-2021  rillig tests/lint: demonstrate wrong warning for '?' in getopt
 1.3 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.2 20-Feb-2021  rillig lint: reproduce the crash from ckgetopt.c 1.2

The intention of the getopt check was to analyze only those while loops
whose condition consists of the usual getopt call. For all other while
loops, ck.while_level was intended to stay at 0.

This was not the case in ckgetopt.c 1.2 and has been fixed in ckgetopt.c
1.3. The code did not document the intended invariants though, which it
should have done. This will be done in a follow-up commit.
 1.1 19-Feb-2021  rillig lint: warn about mismatch in getopt handling
 1.9.2.1 02-Aug-2025  perseant Sync with HEAD
 1.7 17-Jun-2022  rillig 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'.
 1.6 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.5 09-Oct-2021  rillig lint: warn if a getopt switch tries to handle unreachable ':'
 1.4 09-Oct-2021  rillig tests/lint: test getopt with an options string starting with ':'
 1.3 22-Aug-2021  rillig lint: fix wrong warning about '?' in getopt
 1.2 22-Aug-2021  rillig tests/lint: demonstrate wrong warning for '?' in getopt
 1.1 19-Feb-2021  rillig lint: warn about mismatch in getopt handling
 1.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.2 05-Apr-2021  rillig tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.
 1.1 19-Feb-2021  rillig lint: warn about mismatch in getopt handling
 1.3 17-Jun-2022  rillig 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'.
 1.2 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.1 19-Feb-2021  rillig lint: warn about mismatch in getopt handling
 1.5 07-Jul-2023  rillig 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.4 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.3 16-Apr-2022  rillig lint: model C language levels in a future-compatible way

The options -t, -s and -S are confusing because they are used
inconsistently. The option -S enables C99 features, but when using it
instead of -s, it also doesn't enable all checks required by C90 and
later. Prepare fixing of these inconsistencies by replacing the flag
variables with language levels that can be extended in a
straight-forward way as new C standards arrive.

| option | allow_trad | allow_c90 | allow_c99 | allow_c11 |
|--------|------------|-----------|-----------|-----------|
| -t | x | - | - | - |
| (none) | x | x | - | - |
| -s | - | x | - | - |
| -S | - | x | x | - |
| -Ac11 | - | x | x | x |

Each usage of the old flag variables will be inspected and migrated
individually, to clean up the subtle variations in the conditions and to
provide a simpler model.

When lint was created in 1995, its focus was migrating traditional C
code to C90 code. Lint does not help in migrating from C90 to C99 or
from C99 to C11 since there are only few silent changes, and simply
because nobody took the time to implement these migration aids. If
necessary, such migration modes could be added separately.

There is a small functional change: when the option -s is combined with
either -S or -Ac11, lint now only keeps the last of these options.
Previously, these options could be combined, leading to a mixture of
language levels, halfway between C90, C99 and C11. Especially combining
traditional C with C11 doesn't make sense, but xlint currently allows
it.

The 3 tests that accidentally specified multiple language levels have
been adjusted to a single language level.
 1.2 05-Jul-2021  rillig lint: rename message 340 to talk about "GCC extension", not "GNU"
 1.1 07-Mar-2021  rillig lint: in strict C mode, warn about initialization with '[a ... b]'

https://gcc.gnu.org/onlinedocs/gcc/Case-Ranges.html
 1.6 17-Jun-2022  rillig 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'.
 1.5 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.4 16-Apr-2022  rillig lint: model C language levels in a future-compatible way

The options -t, -s and -S are confusing because they are used
inconsistently. The option -S enables C99 features, but when using it
instead of -s, it also doesn't enable all checks required by C90 and
later. Prepare fixing of these inconsistencies by replacing the flag
variables with language levels that can be extended in a
straight-forward way as new C standards arrive.

| option | allow_trad | allow_c90 | allow_c99 | allow_c11 |
|--------|------------|-----------|-----------|-----------|
| -t | x | - | - | - |
| (none) | x | x | - | - |
| -s | - | x | - | - |
| -S | - | x | x | - |
| -Ac11 | - | x | x | x |

Each usage of the old flag variables will be inspected and migrated
individually, to clean up the subtle variations in the conditions and to
provide a simpler model.

When lint was created in 1995, its focus was migrating traditional C
code to C90 code. Lint does not help in migrating from C90 to C99 or
from C99 to C11 since there are only few silent changes, and simply
because nobody took the time to implement these migration aids. If
necessary, such migration modes could be added separately.

There is a small functional change: when the option -s is combined with
either -S or -Ac11, lint now only keeps the last of these options.
Previously, these options could be combined, leading to a mixture of
language levels, halfway between C90, C99 and C11. Especially combining
traditional C with C11 doesn't make sense, but xlint currently allows
it.

The 3 tests that accidentally specified multiple language levels have
been adjusted to a single language level.
 1.3 05-Jul-2021  rillig lint: rename message 340 to talk about "GCC extension", not "GNU"
 1.2 21-Mar-2021  rillig lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.
 1.1 07-Mar-2021  rillig lint: in strict C mode, warn about initialization with '[a ... b]'

https://gcc.gnu.org/onlinedocs/gcc/Case-Ranges.html
 1.5 28-Jan-2025  rillig tests/lint: fix platform-specific tests for <ctype.h> usage

On arm (32-bit, ptrdiff_t is long), there was an extra warning that
didn't show up on i386 or x86_64.

After moving the test to the platform-specific tests, the i386 test shows
an additional warning about integer overflow. This is because the
platform-specific tests run with more lint warnings enabled than in
msg_341.c.
 1.4 18-Dec-2024  rillig lint: warn about unusual argument types in <ctype.h> functions
 1.3 28-Mar-2023  rillig branches: 1.3.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.2 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.1 05-Apr-2021  rillig lint: warn about for wrong type cast in argument to ctype.h functions

The argument to most of the functions from <ctype.h> "shall either be
representable as an 'unsigned char' or shall equal the value of the
macro EOF".

When confronted with the infamous warning 'array subscript has type
char', there are enough programmers who don't know the background of
that warning and thus fix it in a wrong way. Neither GCC nor Clang
explain its warning to target these programmers.

Both GCC and Clang warn about 'array subscript has type char', but they
ignore the other requirements of the <ctype.h> functions, even though
these are in the C standard library.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94182
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95177
https://stackoverflow.com/a/60696378
 1.3.2.1 02-Aug-2025  perseant Sync with HEAD
 1.2 17-Jun-2022  rillig 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'.
 1.1 05-Apr-2021  rillig lint: warn about for wrong type cast in argument to ctype.h functions

The argument to most of the functions from <ctype.h> "shall either be
representable as an 'unsigned char' or shall equal the value of the
macro EOF".

When confronted with the infamous warning 'array subscript has type
char', there are enough programmers who don't know the background of
that warning and thus fix it in a wrong way. Neither GCC nor Clang
explain its warning to target these programmers.

Both GCC and Clang warn about 'array subscript has type char', but they
ignore the other requirements of the <ctype.h> functions, even though
these are in the C standard library.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94182
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95177
https://stackoverflow.com/a/60696378
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 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.3 25-Jul-2021  rillig lint: split is_ctype_function into separate parts

This reduces the number of string comparisons for function names that
start with 'is' or 'to'.

The tests now cover function names that start with 'is' or 'to' but are
not one of the well-known functions from ctype.h. This removes the '*'
in the output from gcov.

No functional change.
 1.2 25-Jul-2021  rillig tests/lint: cover code in ckctype.c
 1.1 05-Apr-2021  rillig lint: warn about for wrong type cast in argument to ctype.h functions

The argument to most of the functions from <ctype.h> "shall either be
representable as an 'unsigned char' or shall equal the value of the
macro EOF".

When confronted with the infamous warning 'array subscript has type
char', there are enough programmers who don't know the background of
that warning and thus fix it in a wrong way. Neither GCC nor Clang
explain its warning to target these programmers.

Both GCC and Clang warn about 'array subscript has type char', but they
ignore the other requirements of the <ctype.h> functions, even though
these are in the C standard library.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94182
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95177
https://stackoverflow.com/a/60696378
 1.5 17-Jun-2022  rillig 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'.
 1.4 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.3 25-Jul-2021  rillig lint: split is_ctype_function into separate parts

This reduces the number of string comparisons for function names that
start with 'is' or 'to'.

The tests now cover function names that start with 'is' or 'to' but are
not one of the well-known functions from ctype.h. This removes the '*'
in the output from gcov.

No functional change.
 1.2 25-Jul-2021  rillig tests/lint: cover code in ckctype.c
 1.1 05-Apr-2021  rillig lint: warn about for wrong type cast in argument to ctype.h functions

The argument to most of the functions from <ctype.h> "shall either be
representable as an 'unsigned char' or shall equal the value of the
macro EOF".

When confronted with the infamous warning 'array subscript has type
char', there are enough programmers who don't know the background of
that warning and thus fix it in a wrong way. Neither GCC nor Clang
explain its warning to target these programmers.

Both GCC and Clang warn about 'array subscript has type char', but they
ignore the other requirements of the <ctype.h> functions, even though
these are in the C standard library.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94182
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95177
https://stackoverflow.com/a/60696378
 1.11 28-Jan-2024  rillig tests/lint: sort multiple diagnostics per line chronologically

For now, the chronologic order is not enforced but has to be established
manually, for example by removing all 'expect' comment lines and
regenerating them with 'accept.sh -u'.

While here, clean up a few instances that came up when regenerating the
'expect' comments, such as wrong indentation or needless deviation from
the 'expect+1' form.
 1.10 14-Sep-2023  rillig lint: fix wording of diagnostics about 'C99 extension'

The term 'extension' means an extension to a C standard. C99 by itself
is not an extension but a revision of the C standard.
 1.9 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.8 21-Jun-2022  rillig lint: add quotes and details to some more messages
 1.7 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.6 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.5 15-Jul-2021  rillig tests/lint: cover more edge cases in the parser
 1.4 14-Apr-2021  rillig tests/lint: adjust test for C11 to the change in grammar and options
 1.3 14-Apr-2021  rillig lint: add option to accept C11 features

The list of available letters for the command line options gets shorter
and shorter. Most of the interesting letters are already used for some
warning categories. Curiously, -A, -W and -E were all still available.

The option -A nicely matches the intention of the option, which is to
allow a certain set of language features. To keep the option available
for further extensions, define -Ac11 as the currently only valid option
of that kind. This allows straight-forward extension for C17 and future
language standards, as well as independent feature-sets. The options -W
and -E may someday complement the -A option, using the allow/warn/error
categories.
 1.2 14-Apr-2021  rillig lint: add support for C11-isms such as int[static 3]
 1.1 14-Apr-2021  rillig lint: add test for newly added message about static array size
 1.7 17-Jun-2022  rillig 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'.
 1.6 17-Jun-2022  rillig tests/lint: add more details to tests from msg_300 until msg_343
 1.5 03-Aug-2021  rillig lint: add quotes around placeholder in message 214

function '%s' expects to return value
 1.4 15-Jul-2021  rillig tests/lint: cover more edge cases in the parser
 1.3 14-Apr-2021  rillig tests/lint: adjust test for C11 to the change in grammar and options
 1.2 14-Apr-2021  rillig lint: add support for C11-isms such as int[static 3]
 1.1 14-Apr-2021  rillig lint: add test for newly added message about static array size
 1.2 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.1 16-May-2021  rillig branches: 1.1.2;
lint: add more specific warning for bit-field of type plain 'int'

Previously, declaring a bit-field of type plain 'int' resulted in this
warning:

warning: nonportable bit-field type 'int' [34]

This warning was too unspecific to be actionable, and until yesterday it
didn't even include the type. In order to allow this warning to be
understood and properly fixed, describe the actual nonportability more
precisely:

warning: bit-field of type plain 'int' has
implementation-defined signedness [344]
 1.1.2.2 31-May-2021  cjep sync with head
 1.1.2.1 16-May-2021  cjep file msg_344.c was added on branch cjep_staticlib_x on 2021-05-31 22:15:24 +0000
 1.2 17-Jun-2022  rillig 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'.
 1.1 16-May-2021  rillig branches: 1.1.2;
lint: add more specific warning for bit-field of type plain 'int'

Previously, declaring a bit-field of type plain 'int' resulted in this
warning:

warning: nonportable bit-field type 'int' [34]

This warning was too unspecific to be actionable, and until yesterday it
didn't even include the type. In order to allow this warning to be
understood and properly fixed, describe the actual nonportability more
precisely:

warning: bit-field of type plain 'int' has
implementation-defined signedness [344]
 1.1.2.2 31-May-2021  cjep sync with head
 1.1.2.1 16-May-2021  cjep file msg_344.exp was added on branch cjep_staticlib_x on 2021-05-31 22:15:24 +0000
 1.4 07-Jul-2023  rillig 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.3 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.2 27-Jun-2021  rillig lint: fix result type of _Generic expressions
 1.1 27-Jun-2021  rillig lint: require C11 for _Generic

This does not have any effect in practice since the option -g
(originally meant for GCC extensions to the C standards) implicitly
allows all features from C11, since err.c 1.111 from 2021-04-14.

Since the default lint flags for NetBSD builds include the option -g,
this allows all C11 features.

Currently it is not possible to say "allow GNU extensions but not C11".
 1.2 17-Jun-2022  rillig 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'.
 1.1 27-Jun-2021  rillig lint: require C11 for _Generic

This does not have any effect in practice since the option -g
(originally meant for GCC extensions to the C standards) implicitly
allows all features from C11, since err.c 1.111 from 2021-04-14.

Since the default lint flags for NetBSD builds include the option -g,
this allows all C11 features.

Currently it is not possible to say "allow GNU extensions but not C11".
 1.10 31-Aug-2024  rillig lint: KNF
 1.9 02-Aug-2023  rillig branches: 1.9.2;
lint: fix plural form in message 150
 1.8 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.7 22-Jun-2022  rillig lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.
 1.6 09-Oct-2021  rillig lint: warn that bsearch effectively discards 'const'

Just like strchr, bsearch takes a const pointer and returns a non-const
pointer into the same object.
 1.5 09-Oct-2021  rillig tests/lint: test effective unconst cast using bsearch

Seen in usr.bin/indent/lexi.c, function lexi.
 1.4 16-Aug-2021  rillig tests/lint: add tests for several messages about type mismatch
 1.3 15-Aug-2021  rillig lint: extend check for unconst functions

The functions memchr, strpbrk, strrchr and strstr effectively remove the
const qualifier of their first argument, just like strchr.
 1.2 15-Aug-2021  rillig tests/lint: add tests for more unconst functions
 1.1 09-Aug-2021  rillig lint: warn about 'char * = strchr(const char *, int)'

Found in findcc.c, there are about 25 other instances of this
incongruency in the whole source tree.

For more examples of functions from the C Standard Library that
implicitly remove the 'const' qualifier from an argument, see the C++
include file 'cstring'.
 1.9.2.1 02-Aug-2025  perseant Sync with HEAD
 1.6 17-Jun-2022  rillig 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'.
 1.5 09-Oct-2021  rillig lint: warn that bsearch effectively discards 'const'

Just like strchr, bsearch takes a const pointer and returns a non-const
pointer into the same object.
 1.4 16-Aug-2021  rillig tests/lint: add tests for several messages about type mismatch
 1.3 15-Aug-2021  rillig lint: extend check for unconst functions

The functions memchr, strpbrk, strrchr and strstr effectively remove the
const qualifier of their first argument, just like strchr.
 1.2 15-Aug-2021  rillig tests/lint: add tests for more unconst functions
 1.1 09-Aug-2021  rillig lint: warn about 'char * = strchr(const char *, int)'

Found in findcc.c, there are about 25 other instances of this
incongruency in the whole source tree.

For more examples of functions from the C Standard Library that
implicitly remove the 'const' qualifier from an argument, see the C++
include file 'cstring'.
 1.7 02-Aug-2023  rillig lint: fix handling of unnamed function parameters
 1.6 02-Aug-2023  rillig lint: distinguish between arguments and parameters
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 13-Sep-2021  rillig lint: continue analysis of wrong type in abstract declaration

No functional change.
 1.2 12-Sep-2021  rillig lint: track down wrong function type in abstract type
 1.1 12-Sep-2021  rillig lint: add more details to error about redeclaration

Message 27 is triggered by several conditions. The one triggered by
register_vget in sbin/fsck_lfs/vnode.c needs more details than the
others.
 1.5 17-Jun-2022  rillig 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'.
 1.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 13-Sep-2021  rillig lint: continue analysis of wrong type in abstract declaration

No functional change.
 1.2 12-Sep-2021  rillig lint: track down wrong function type in abstract type
 1.1 12-Sep-2021  rillig lint: add more details to error about redeclaration

Message 27 is triggered by several conditions. The one triggered by
register_vget in sbin/fsck_lfs/vnode.c needs more details than the
others.
 1.14 11-Jul-2025  rillig lint: fix warning about enum array index

Seen in openssh/fmt_scaled.c, scale_chars.
 1.13 11-Jul-2025  rillig tests/lint: demonstrate wrong warning for enum array index

Seen in openssh/fmt_scaled.c, scale_chars.
 1.12 31-Oct-2024  rillig lint: allow enum constant named 'N_*' to exceed the array index

Seen in libxcb.

While here, add the name of the enum constant to the message, to quickly
decide whether the identifier is outside the range of expected enum
values, thus marking the number of enum constants.
 1.11 29-Oct-2024  rillig lint: add details to message about too large integer constant
 1.10 01-Mar-2024  rillig branches: 1.10.2;
tests/lint: remove redundant documentation
 1.9 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.8 14-Jan-2023  rillig tests/lint: add more tests for array/enum mismatch
 1.7 08-Jan-2023  rillig lint: recognize enum constant named 'max' as a count of values

Seen in external/bsd/mdocml/dist/mdoc.h(50).
 1.6 08-Jan-2023  rillig tests/lint: add more tests for enum/array mismatch
 1.5 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.4 01-Nov-2021  rillig lint: do not warn about array size mismatch in array[(int)enum]

The cast to 'int' explicitly converts the type away from being an enum.
 1.3 01-Nov-2021  rillig lint: in the check for array[enum], allow enum constant NUM

When an enum type defines a constant NUM_VALUES, this constant is
usually not part of the enum values available to the application but
rather a handy place for defining the number of other enum values. Don't
warn about this case.

Seen in openpam_impl.h and several other places.
 1.2 31-Oct-2021  rillig lint: fix invalid memory access in array[enum] check

Lint checks whether in an expression 'array[enum]', the array size
matches the value of the maximum enum constant.

The previous tests for this check were missing the case where an enum
name was explicitly cast to an integer type and then used as an array
index. In this situation, the resulting type of the array index is a
plain 'int' without any information about its previous 'enum' history.

An entirely different case is when the 'enum' is implicitly converted to
an integer type, as in the test color_name_too_many. There, for the
final type of the array index, rn->tn_type->t_is_enum is true, which
means that rn->tn_type->t_enum is properly filled.

The bug was a simple typo, I had forgotten a tn_left indirection, which
is necessary to get the type before the implicit conversion.

Found and reported by Christos, triggered by src/lib/libperfuse/ops.c
1.89 line 1226 expression 'VTTOIF(vap->va_type)'.
 1.1 30-Oct-2021  rillig lint: warn if an enum name is used for mismatched array access

This helps to keep the enum definition and the straight-forward
implementation of a to_string or name function in sync.

The test for message 241 had to be adjusted because of exactly this bug.
That test defined a bit mask enum but accessed it like a value enum
type.
 1.10.2.1 02-Aug-2025  perseant Sync with HEAD
 1.6 17-Jun-2022  rillig 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'.
 1.5 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.4 01-Nov-2021  rillig lint: do not warn about array size mismatch in array[(int)enum]

The cast to 'int' explicitly converts the type away from being an enum.
 1.3 01-Nov-2021  rillig lint: in the check for array[enum], allow enum constant NUM

When an enum type defines a constant NUM_VALUES, this constant is
usually not part of the enum values available to the application but
rather a handy place for defining the number of other enum values. Don't
warn about this case.

Seen in openpam_impl.h and several other places.
 1.2 31-Oct-2021  rillig lint: fix invalid memory access in array[enum] check

Lint checks whether in an expression 'array[enum]', the array size
matches the value of the maximum enum constant.

The previous tests for this check were missing the case where an enum
name was explicitly cast to an integer type and then used as an array
index. In this situation, the resulting type of the array index is a
plain 'int' without any information about its previous 'enum' history.

An entirely different case is when the 'enum' is implicitly converted to
an integer type, as in the test color_name_too_many. There, for the
final type of the array index, rn->tn_type->t_is_enum is true, which
means that rn->tn_type->t_enum is properly filled.

The bug was a simple typo, I had forgotten a tn_left indirection, which
is necessary to get the type before the implicit conversion.

Found and reported by Christos, triggered by src/lib/libperfuse/ops.c
1.89 line 1226 expression 'VTTOIF(vap->va_type)'.
 1.1 30-Oct-2021  rillig lint: warn if an enum name is used for mismatched array access

This helps to keep the enum definition and the straight-forward
implementation of a to_string or name function in sync.

The test for message 241 had to be adjusted because of exactly this bug.
That test defined a bit mask enum but accessed it like a value enum
type.
 1.3 01-Mar-2024  rillig tests/lint: remove redundant documentation
 1.2 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.1 12-May-2022  rillig tests/lint: add more tests for __alignof__
 1.2 17-Jun-2022  rillig 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'.
 1.1 12-May-2022  rillig tests/lint: add more tests for __alignof__
 1.4 01-Mar-2024  rillig tests/lint: remove redundant documentation
 1.3 07-Jul-2023  rillig 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.2 07-Jul-2023  rillig tests/lint: merge duplicate tests for C11 _Atomic
 1.1 21-Jan-2023  rillig lint: add support for the C11 type qualifier '_Atomic'

That keyword can be used as a type specifier as well, support for that
will be added later.
 1.8 01-Mar-2024  rillig tests/lint: remove redundant documentation
 1.7 07-Jul-2023  rillig 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 07-Jul-2023  rillig tests/lint: test all combinations of {func,obj}_{decl,def}

For a non-static function definition that is not declared in a header,
lint doesn't currently warn. The previous test didn't notice this.
 1.5 28-Jun-2023  rillig tests/lint: fix preprocessor line number validation

When running the tests via ATF, the filename was an absolute filename,
while the preprocessing line in the test file uses a relative filename.
These two didn't match.
 1.4 25-Apr-2023  rillig lint: reword message for missing declaration in header

Suggested by Christos.
 1.3 22-Apr-2023  rillig lint: fix wrong warning about 'extern' temporary identifier
 1.2 22-Apr-2023  rillig tests/lint: demonstrate wrong warning about extern temporary identifier
 1.1 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 01-Mar-2024  rillig tests/lint: remove redundant documentation
 1.2 07-Jul-2023  rillig 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.1 28-Mar-2023  rillig lint: warn about 'extern' declarations inside function bodies

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html

The previous attempt (message 351 about 'extern' declarations outside
headers) did not cover the proposal from the tech-userlevel mailing list
but instead warns about a different usage pattern of the 'extern'
keyword.
 1.5 01-Mar-2024  rillig tests/lint: remove redundant documentation
 1.4 14-Jul-2023  rillig lint: clean up comments, add a test for the '?:' operator
 1.3 07-Jul-2023  rillig 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.2 03-Jul-2023  rillig lint: fix C11 mode to not allow C23 features (since yesterday)
 1.1 02-Jul-2023  rillig tests/lint: add C23 tests
 1.2 01-Mar-2024  rillig tests/lint: remove redundant documentation
 1.1 03-Aug-2023  rillig lint: make '_Static_assert' only available in C11 or C23 mode
 1.2 01-Mar-2024  rillig tests/lint: remove redundant documentation
 1.1 03-Aug-2023  rillig lint: make '_Static_assert' only available in C11 or C23 mode
 1.3 25-Mar-2024  rillig lint: rename snprintb 'directives' to 'conversions'

This aligns the terminology with the snprintf function.
 1.2 01-Mar-2024  rillig tests/lint: remove redundant documentation
 1.1 03-Feb-2024  rillig lint: warn about short octal escape followed by '8' or '9'

These mistakes is typically found in snprintb format directives but is
probably a typo everywhere else as well.
 1.3 05-Nov-2024  rillig tests/lint: extend snprintb tests and improve their documentation
 1.2 31-Aug-2024  rillig lint: KNF
 1.1 01-Mar-2024  rillig branches: 1.1.2;
lint: test format strings from snprintb calls

The functions snprintb and snprintb_m are specific to NetBSD, and their
format strings are tricky to get correct. Provide some assistance in
catching the most common mistakes.
 1.1.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 05-Nov-2024  rillig tests/lint: extend snprintb tests and improve their documentation
 1.3 31-Aug-2024  rillig lint: KNF
 1.2 03-Mar-2024  rillig branches: 1.2.2;
lint: warn about escaped snprintb directive

Repurpose message 362, as the previous version was redundant since null
bytes in old-style formats are already covered by message 371 (bit
position out of range) and 377 (redundant '\0' at the end).
 1.1 01-Mar-2024  rillig lint: test format strings from snprintb calls

The functions snprintb and snprintb_m are specific to NetBSD, and their
format strings are tricky to get correct. Provide some assistance in
catching the most common mistakes.
 1.2.2.1 02-Aug-2025  perseant Sync with HEAD
 1.3 05-Nov-2024  rillig tests/lint: extend snprintb tests and improve their documentation
 1.2 31-Aug-2024  rillig lint: KNF
 1.1 01-Mar-2024  rillig branches: 1.1.2;
lint: test format strings from snprintb calls

The functions snprintb and snprintb_m are specific to NetBSD, and their
format strings are tricky to get correct. Provide some assistance in
catching the most common mistakes.
 1.1.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 05-Nov-2024  rillig tests/lint: extend snprintb tests and improve their documentation
 1.3 31-Aug-2024  rillig lint: KNF
 1.2 03-Mar-2024  rillig branches: 1.2.2;
lint: check for unreachable bits and fields in snprintb formats

While here, clean up a few existing checks.
 1.1 01-Mar-2024  rillig lint: test format strings from snprintb calls

The functions snprintb and snprintb_m are specific to NetBSD, and their
format strings are tricky to get correct. Provide some assistance in
catching the most common mistakes.
 1.2.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 05-Nov-2024  rillig tests/lint: extend snprintb tests and improve their documentation
 1.3 31-Aug-2024  rillig lint: KNF
 1.2 03-Mar-2024  rillig branches: 1.2.2;
lint: check for unreachable bits and fields in snprintb formats

While here, clean up a few existing checks.
 1.1 01-Mar-2024  rillig lint: test format strings from snprintb calls

The functions snprintb and snprintb_m are specific to NetBSD, and their
format strings are tricky to get correct. Provide some assistance in
catching the most common mistakes.
 1.2.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 31-Aug-2024  rillig lint: KNF
 1.3 25-Mar-2024  rillig branches: 1.3.2;
lint: rename snprintb 'directives' to 'conversions'

This aligns the terminology with the snprintf function.
 1.2 03-Mar-2024  rillig lint: warn about escaped snprintb directive

Repurpose message 362, as the previous version was redundant since null
bytes in old-style formats are already covered by message 371 (bit
position out of range) and 377 (redundant '\0' at the end).
 1.1 01-Mar-2024  rillig lint: test format strings from snprintb calls

The functions snprintb and snprintb_m are specific to NetBSD, and their
format strings are tricky to get correct. Provide some assistance in
catching the most common mistakes.
 1.3.2.1 02-Aug-2025  perseant Sync with HEAD
 1.7 05-Nov-2024  rillig tests/lint: extend snprintb tests and improve their documentation
 1.6 31-Aug-2024  rillig lint: KNF
 1.5 12-Apr-2024  rillig branches: 1.5.2;
lint: in snprintb, warn about all escaped characters in descriptions
 1.4 03-Mar-2024  rillig lint: clean up string parsing and snprintb check
 1.3 03-Mar-2024  rillig lint: warn about escaped snprintb directive

Repurpose message 362, as the previous version was redundant since null
bytes in old-style formats are already covered by message 371 (bit
position out of range) and 377 (redundant '\0' at the end).
 1.2 03-Mar-2024  rillig lint: fix warning about "empty" single-letter snprintb descriptions
 1.1 01-Mar-2024  rillig lint: test format strings from snprintb calls

The functions snprintb and snprintb_m are specific to NetBSD, and their
format strings are tricky to get correct. Provide some assistance in
catching the most common mistakes.
 1.5.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 31-Aug-2024  rillig lint: KNF
 1.3 25-Mar-2024  rillig branches: 1.3.2;
lint: rename snprintb 'directives' to 'conversions'

This aligns the terminology with the snprintf function.
 1.2 03-Mar-2024  rillig lint: fix warning about "empty" single-letter snprintb descriptions
 1.1 01-Mar-2024  rillig lint: test format strings from snprintb calls

The functions snprintb and snprintb_m are specific to NetBSD, and their
format strings are tricky to get correct. Provide some assistance in
catching the most common mistakes.
 1.3.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 31-Aug-2024  rillig lint: KNF
 1.3 25-Mar-2024  rillig branches: 1.3.2;
lint: rename snprintb 'directives' to 'conversions'

This aligns the terminology with the snprintf function.
 1.2 03-Mar-2024  rillig lint: fix warning about "empty" single-letter snprintb descriptions
 1.1 01-Mar-2024  rillig lint: test format strings from snprintb calls

The functions snprintb and snprintb_m are specific to NetBSD, and their
format strings are tricky to get correct. Provide some assistance in
catching the most common mistakes.
 1.3.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 31-Aug-2024  rillig lint: KNF
 1.4 25-Mar-2024  rillig branches: 1.4.2;
lint: rename snprintb 'directives' to 'conversions'

This aligns the terminology with the snprintf function.
 1.3 03-Mar-2024  rillig lint: fix warning about "empty" single-letter snprintb descriptions
 1.2 03-Mar-2024  rillig lint: check for unreachable bits and fields in snprintb formats

While here, clean up a few existing checks.
 1.1 01-Mar-2024  rillig lint: test format strings from snprintb calls

The functions snprintb and snprintb_m are specific to NetBSD, and their
format strings are tricky to get correct. Provide some assistance in
catching the most common mistakes.
 1.4.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 31-Aug-2025  rillig lint: check for mismatches in snprintb conversions

Seen in sh3/dmacreg.h, SH3_DMAC_CHCR_BITS.
 1.3 31-Aug-2024  rillig lint: KNF
 1.2 03-Mar-2024  rillig branches: 1.2.2;
lint: fix warning about "empty" single-letter snprintb descriptions
 1.1 01-Mar-2024  rillig lint: test format strings from snprintb calls

The functions snprintb and snprintb_m are specific to NetBSD, and their
format strings are tricky to get correct. Provide some assistance in
catching the most common mistakes.
 1.2.2.1 02-Aug-2025  perseant Sync with HEAD
 1.3 31-Aug-2024  rillig lint: KNF
 1.2 25-Mar-2024  rillig branches: 1.2.2;
lint: rename snprintb 'directives' to 'conversions'

This aligns the terminology with the snprintf function.
 1.1 01-Mar-2024  rillig lint: test format strings from snprintb calls

The functions snprintb and snprintb_m are specific to NetBSD, and their
format strings are tricky to get correct. Provide some assistance in
catching the most common mistakes.
 1.2.2.1 02-Aug-2025  perseant Sync with HEAD
 1.3 31-Aug-2024  rillig lint: KNF
 1.2 02-Mar-2024  rillig branches: 1.2.2;
lint: check snprintb formats for overlapping bits and fields
 1.1 01-Mar-2024  rillig lint: test format strings from snprintb calls

The functions snprintb and snprintb_m are specific to NetBSD, and their
format strings are tricky to get correct. Provide some assistance in
catching the most common mistakes.
 1.2.2.1 02-Aug-2025  perseant Sync with HEAD
 1.3 31-Aug-2024  rillig lint: KNF
 1.2 02-Mar-2024  rillig branches: 1.2.2;
lint: check snprintb formats for overlapping bits and fields
 1.1 01-Mar-2024  rillig lint: test format strings from snprintb calls

The functions snprintb and snprintb_m are specific to NetBSD, and their
format strings are tricky to get correct. Provide some assistance in
catching the most common mistakes.
 1.2.2.1 02-Aug-2025  perseant Sync with HEAD
 1.3 31-Aug-2024  rillig lint: KNF
 1.2 12-Apr-2024  rillig branches: 1.2.2;
lint: in snprintb, warn about all escaped characters in descriptions
 1.1 01-Mar-2024  rillig lint: test format strings from snprintb calls

The functions snprintb and snprintb_m are specific to NetBSD, and their
format strings are tricky to get correct. Provide some assistance in
catching the most common mistakes.
 1.2.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 31-Aug-2024  rillig lint: KNF
 1.3 03-Mar-2024  rillig branches: 1.3.2;
lint: warn about escaped snprintb directive

Repurpose message 362, as the previous version was redundant since null
bytes in old-style formats are already covered by message 371 (bit
position out of range) and 377 (redundant '\0' at the end).
 1.2 02-Mar-2024  rillig lint: check snprintb formats for overlapping bits and fields
 1.1 01-Mar-2024  rillig lint: test format strings from snprintb calls

The functions snprintb and snprintb_m are specific to NetBSD, and their
format strings are tricky to get correct. Provide some assistance in
catching the most common mistakes.
 1.3.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 31-Aug-2024  rillig lint: KNF
 1.3 03-Mar-2024  rillig branches: 1.3.2;
lint: warn about escaped snprintb directive

Repurpose message 362, as the previous version was redundant since null
bytes in old-style formats are already covered by message 371 (bit
position out of range) and 377 (redundant '\0' at the end).
 1.2 02-Mar-2024  rillig lint: check snprintb formats for overlapping bits and fields
 1.1 01-Mar-2024  rillig lint: test format strings from snprintb calls

The functions snprintb and snprintb_m are specific to NetBSD, and their
format strings are tricky to get correct. Provide some assistance in
catching the most common mistakes.
 1.3.2.1 02-Aug-2025  perseant Sync with HEAD
 1.6 31-Aug-2024  rillig lint: KNF
 1.5 25-Mar-2024  rillig branches: 1.5.2;
lint: rename snprintb 'directives' to 'conversions'

This aligns the terminology with the snprintf function.
 1.4 03-Mar-2024  rillig lint: warn about escaped snprintb directive

Repurpose message 362, as the previous version was redundant since null
bytes in old-style formats are already covered by message 371 (bit
position out of range) and 377 (redundant '\0' at the end).
 1.3 03-Mar-2024  rillig lint: fix warning about "empty" single-letter snprintb descriptions
 1.2 03-Mar-2024  rillig lint: check for unreachable bits and fields in snprintb formats

While here, clean up a few existing checks.
 1.1 01-Mar-2024  rillig lint: test format strings from snprintb calls

The functions snprintb and snprintb_m are specific to NetBSD, and their
format strings are tricky to get correct. Provide some assistance in
catching the most common mistakes.
 1.5.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 31-Aug-2024  rillig lint: KNF
 1.3 03-Mar-2024  rillig branches: 1.3.2;
lint: check for unreachable bits and fields in snprintb formats

While here, clean up a few existing checks.
 1.2 02-Mar-2024  rillig lint: check snprintb formats for overlapping bits and fields
 1.1 01-Mar-2024  rillig lint: test format strings from snprintb calls

The functions snprintb and snprintb_m are specific to NetBSD, and their
format strings are tricky to get correct. Provide some assistance in
catching the most common mistakes.
 1.3.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 31-Aug-2024  rillig lint: KNF
 1.3 12-Apr-2024  rillig branches: 1.3.2;
lint: in snprintb, warn about all escaped characters in descriptions
 1.2 03-Mar-2024  rillig lint: check for unreachable bits and fields in snprintb formats

While here, clean up a few existing checks.
 1.1 02-Mar-2024  rillig lint: check snprintb formats for overlapping bits and fields
 1.3.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 31-Aug-2024  rillig lint: KNF
 1.4 25-Mar-2024  rillig branches: 1.4.2;
lint: rename snprintb 'directives' to 'conversions'

This aligns the terminology with the snprintf function.
 1.3 03-Mar-2024  rillig lint: warn about escaped snprintb directive

Repurpose message 362, as the previous version was redundant since null
bytes in old-style formats are already covered by message 371 (bit
position out of range) and 377 (redundant '\0' at the end).
 1.2 03-Mar-2024  rillig lint: fix warning about "empty" single-letter snprintb descriptions
 1.1 03-Mar-2024  rillig lint: check for unreachable bits and fields in snprintb formats

While here, clean up a few existing checks.
 1.4.2.1 02-Aug-2025  perseant Sync with HEAD
 1.3 31-Aug-2024  rillig lint: KNF
 1.2 25-Mar-2024  rillig branches: 1.2.2;
lint: rename snprintb 'directives' to 'conversions'

This aligns the terminology with the snprintf function.
 1.1 03-Mar-2024  rillig lint: check for unreachable bits and fields in snprintb formats

While here, clean up a few existing checks.
 1.2.2.1 02-Aug-2025  perseant Sync with HEAD
 1.2 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.1 11-May-2024  rillig branches: 1.1.2;
lint: warn when comparing an integer to a floating point constant
 1.1.2.1 02-Aug-2025  perseant Sync with HEAD
 1.2 22-Jun-2024  rillig tests/lint: skip tests for converting large floating point to integer

These tests differ between the platforms supported by lint. The
differences may be caused by hardware differences, the default rounding
mode, bugs in the emulator running the tests, bugs in the
platform-specific string-to-float or float-to-string conversions and
probably some more.

For now, accept that lint will behave differently on those platforms.
 1.1 09-Jun-2024  rillig lint: warn about lossy floating point constant to integer conversions
 1.2 22-Jun-2024  rillig tests/lint: skip tests for converting large floating point to integer

These tests differ between the platforms supported by lint. The
differences may be caused by hardware differences, the default rounding
mode, bugs in the emulator running the tests, bugs in the
platform-specific string-to-float or float-to-string conversions and
probably some more.

For now, accept that lint will behave differently on those platforms.
 1.1 09-Jun-2024  rillig lint: warn about lossy floating point constant to integer conversions
 1.2 12-Apr-2025  rillig branches: 1.2.4;
lint: warn about constant assignment in operand to '&&' or '||'

Seen in bin/sh/redir.c:1084 for errno, which is fine.

Seen in usr.sbin/mopd/mopprobe/mopprobe.c:235, which looks suspicious
but hasn't been touched since 1997.
 1.1 10-Jul-2024  rillig lint: add warning for '!(var = constant)'

This catches expressions like 'ATF_CHECK(errno = ENOENT)', which was
intended to use '==' instead of '='.
 1.2.4.2 02-Aug-2025  perseant Sync with HEAD
 1.2.4.1 12-Apr-2025  perseant file msg_382.c was added on branch perseant-exfatfs on 2025-08-02 05:58:19 +0000
 1.4 04-May-2025  rillig branches: 1.4.4;
lint: in a parameter declaration using typedef, keep the qualifiers

While C23 6.7.7.4p6 doesn't explicitly mention this particular case of a
'const typedef', keeping the qualifiers fixes a warning in probably
legitimate code.

Seen in cvs, regex_internal.c, function 'bitset_contain'.
 1.3 04-May-2025  rillig tests/lint: demonstrate wrong interpretation of const pointer parameter

Seen in external/gpl2/xcvs/dist/lib/regex_internal.c:697.
 1.2 04-May-2025  rillig lint: add more details to message about discarding qualifiers

The name of the function (or, if not available, its type) is useful in
lines that contain more than one function call.
 1.1 23-Nov-2024  rillig lint: use separate message when discarding a qualifier in call
 1.4.4.2 02-Aug-2025  perseant Sync with HEAD
 1.4.4.1 04-May-2025  perseant file msg_383.c was added on branch perseant-exfatfs on 2025-08-02 05:58:19 +0000
 1.2 03-Jan-2025  rillig branches: 1.2.4;
lint: add detail to message about obsolete identifier list
 1.1 01-Dec-2024  rillig lint: warn about function definitions that still use identifier lists
 1.2.4.2 02-Aug-2025  perseant Sync with HEAD
 1.2.4.1 03-Jan-2025  perseant file msg_384.c was added on branch perseant-exfatfs on 2025-08-02 05:58:19 +0000
 1.2 10-Mar-2025  rillig branches: 1.2.4;
lint: only warn about do-while macro if the 'do' is a keyword
 1.1 08-Dec-2024  rillig lint: warn about do-while macros that end with a semicolon
 1.2.4.2 02-Aug-2025  perseant Sync with HEAD
 1.2.4.1 10-Mar-2025  perseant file msg_385.c was added on branch perseant-exfatfs on 2025-08-02 05:58:19 +0000
 1.1 31-Aug-2025  rillig lint: check for mismatches in snprintb conversions

Seen in sh3/dmacreg.h, SH3_DMAC_CHCR_BITS.
 1.8 28-Jan-2024  rillig tests/lint: sort multiple diagnostics per line chronologically

For now, the chronologic order is not enforced but has to be established
manually, for example by removing all 'expect' comment lines and
regenerating them with 'accept.sh -u'.

While here, clean up a few instances that came up when regenerating the
'expect' comments, such as wrong indentation or needless deviation from
the 'expect+1' form.
 1.7 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.6 04-Jan-2023  rillig tests/lint: merge tests for ':?' with null pointer constant
 1.5 04-Jan-2023  rillig lint: fix the result type of '?:' for void pointers

The change from 2015-07-29 was wrong since that rule only applies to
null pointer constants but not to other void pointers.
 1.4 03-Jan-2023  rillig tests/lint: demonstrate wrong type for '?:' expressions
 1.3 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.2 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.1 02-Apr-2021  rillig tests/lint: prevent typo from tree.c 1.264 from happening again
 1.3 17-Jun-2022  rillig 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'.
 1.2 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.1 02-Apr-2021  rillig tests/lint: prevent typo from tree.c 1.264 from happening again
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 19-Aug-2022  rillig lint: add more details to message about large bit-shifts
 1.3 21-Aug-2021  rillig tests/lint: guard against typos in test environment configuration

Some tests had "lint1-only-if" without a trailing colon, others included
the trailing colon. The tests that included the trailing colon were run
even though they were supposed to be skipped, and they failed, as could
be expected.

To prevent further typos, always require the trailing colon, just as in
"lint1-flags" and fail fast on unknown "lint1" comments.
 1.2 31-Jul-2021  rillig lint: improve support for __int128_t and __uint128_t

For the .ln files, I chose the letter 'J' to represent the 128-bit
integer types since it is close to 'I' for int. The naming of 'L' for
'long' is obvious, but 'Q' for 64-bit integers is a quad-16-bit word,
which is an unusual measurement unit nowadays. One benefit of choosing
'J' is that the next letter, 'K' can then be used for 256-bit integer
types.

Support for 128-bit integer types is still very basic. Plus, it is only
supported on LP64 platforms, which means that lint cannot be
cross-compiled to check for an LP64 platform while running on an ILP32
platform.
 1.1 04-Jul-2021  rillig test/lint: demonstrate wrong warnings for 128-bit shifts
 1.3 17-Jun-2022  rillig 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'.
 1.2 31-Jul-2021  rillig lint: improve support for __int128_t and __uint128_t

For the .ln files, I chose the letter 'J' to represent the 128-bit
integer types since it is close to 'I' for int. The naming of 'L' for
'long' is obvious, but 'Q' for 64-bit integers is a quad-16-bit word,
which is an unusual measurement unit nowadays. One benefit of choosing
'J' is that the next letter, 'K' can then be used for 256-bit integer
types.

Support for 128-bit integer types is still very basic. Plus, it is only
supported on LP64 platforms, which means that lint cannot be
cross-compiled to check for an LP64 platform while running on an ILP32
platform.
 1.1 04-Jul-2021  rillig test/lint: demonstrate wrong warnings for 128-bit shifts
 1.4 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.3 25-Jul-2021  rillig tests/lint: cover every code line in the grammar
 1.2 25-Jul-2021  rillig lint: fix parsing of GNU __attribute__ after __asm

GCC only accepts them in the order __asm __attribute__, not the other
way round. So should lint.
 1.1 25-Jul-2021  rillig tests/lint: test declarators with attributes
 1.3 17-Jun-2022  rillig 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'.
 1.2 25-Jul-2021  rillig lint: fix parsing of GNU __attribute__ after __asm

GCC only accepts them in the order __asm __attribute__, not the other
way round. So should lint.
 1.1 25-Jul-2021  rillig tests/lint: test declarators with attributes
 1.3 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.2 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.1 25-Jul-2021  rillig tests/lint: test parse errors in statements

These errors are really unrealistic. Most parse errors that occur in
statements are already handled elsewhere and continue with the next
semicolon.

The tests had to be split into two separate files because lint assumes
that after the 5th parse error, it does not make sense to continue this
translation unit.
 1.2 17-Jun-2022  rillig 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'.
 1.1 25-Jul-2021  rillig tests/lint: test parse errors in statements

These errors are really unrealistic. Most parse errors that occur in
statements are already handled elsewhere and continue with the next
semicolon.

The tests had to be split into two separate files because lint assumes
that after the 5th parse error, it does not make sense to continue this
translation unit.
 1.3 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.2 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.1 25-Jul-2021  rillig tests/lint: test parse errors in statements

These errors are really unrealistic. Most parse errors that occur in
statements are already handled elsewhere and continue with the next
semicolon.

The tests had to be split into two separate files because lint assumes
that after the 5th parse error, it does not make sense to continue this
translation unit.
 1.2 17-Jun-2022  rillig 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'.
 1.1 25-Jul-2021  rillig tests/lint: test parse errors in statements

These errors are really unrealistic. Most parse errors that occur in
statements are already handled elsewhere and continue with the next
semicolon.

The tests had to be split into two separate files because lint assumes
that after the 5th parse error, it does not make sense to continue this
translation unit.
 1.12 26-Aug-2023  rillig lint: make diagnostics about ANSI C more international
 1.11 02-Aug-2023  rillig lint: fix handling of unnamed function parameters
 1.10 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.9 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.8 01-Apr-2022  rillig lint: add type details to message about 'sizeof(function)'

The code in add_function is severely broken, it mixes up the return type
of the function with the argument types. For now, at least show the
guessed type in the diagnostic, to allow human readers quickly spot the
bug.

Extend the test cases in decl_direct_abstract.c to show that the
behavior differs unreasonably if the first parameter of the function is
equal to its return type.
 1.7 25-Jul-2021  rillig tests/lint: cover every code line in the grammar
 1.6 25-Jul-2021  rillig tests/lint: explain where the second __attribute__ comes from
 1.5 25-Jul-2021  rillig tests/lint: fix unintended line breaks
 1.4 25-Jul-2021  rillig lint: fix parsing of 'typeof(double(typeof(0.0)))'

By removing the misplaced grammar rule 'abstract_declarator: T_TYPEOF',
the type expression 'typeof(double(typeof(0.0)))' is no longer
interpreted as a declarator, but rather as a type specifier, just as in
the GCC parser.

This resolves 7 shift/reduce conflicts.
 1.3 25-Jul-2021  rillig tests/lint: try harder to reduce 'abstract_declarator: T_TYPEOF'

At the top level of a type_name, declaration-specifiers take precedence,
but these cannot look inside the parentheses of a
direct-abstract-declarator.
 1.2 25-Jul-2021  rillig tests/lint: document unreachable 'abstract_declarator: T_TYPEOF'
 1.1 25-Jul-2021  rillig tests/lint: test parsing of type_name
 1.8 17-Jun-2022  rillig 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'.
 1.7 01-Apr-2022  rillig lint: add type details to message about 'sizeof(function)'

The code in add_function is severely broken, it mixes up the return type
of the function with the argument types. For now, at least show the
guessed type in the diagnostic, to allow human readers quickly spot the
bug.

Extend the test cases in decl_direct_abstract.c to show that the
behavior differs unreasonably if the first parameter of the function is
equal to its return type.
 1.6 25-Jul-2021  rillig tests/lint: explain where the second __attribute__ comes from
 1.5 25-Jul-2021  rillig tests/lint: fix unintended line breaks
 1.4 25-Jul-2021  rillig lint: fix parsing of 'typeof(double(typeof(0.0)))'

By removing the misplaced grammar rule 'abstract_declarator: T_TYPEOF',
the type expression 'typeof(double(typeof(0.0)))' is no longer
interpreted as a declarator, but rather as a type specifier, just as in
the GCC parser.

This resolves 7 shift/reduce conflicts.
 1.3 25-Jul-2021  rillig tests/lint: try harder to reduce 'abstract_declarator: T_TYPEOF'

At the top level of a type_name, declaration-specifiers take precedence,
but these cannot look inside the parentheses of a
direct-abstract-declarator.
 1.2 25-Jul-2021  rillig tests/lint: document unreachable 'abstract_declarator: T_TYPEOF'
 1.1 25-Jul-2021  rillig tests/lint: test parsing of type_name
 1.6 08-Jun-2024  rillig lint: add details to warnings about negative constant to unsigned
 1.5 27-Mar-2024  rillig lint: don't use 'long' in diagnostics

The size of 'long' differs between 64-bit and 32-bit platforms.
Eliminate this possible platform-dependency.
 1.4 27-Feb-2023  rillig lint: split platform-specific test for loss of accuracy

Lint distinguishes between platforms where size_t is unsigned int and
platforms where size_t is unsigned long.
 1.3 22-Feb-2023  rillig tests/lint: add platform-specific tests
 1.2 26-Sep-2021  rillig tests/lint: run all platform tests with the same options
 1.1 26-Sep-2021  rillig tests/lint: add tests for platform characteristics

Running lint in usr.bin/make on i386 fails due to this warning:

cond.c(800): warning: argument #3 is converted from 'unsigned char' to
'unsigned int' due to prototype [259]

This warning only occurred on i386 but not on sparc or x86_64. Try to
reproduce the test situation in platform_int.

The platform code in t_integration.sh was not strict enough, it didn't
check for multiple conditions, such as in msg_132_ilp32. That test was
only supposed to run on ILP32 platforms where size_t is unsigned int. It
also ran on sparc, even though size_t is long there.
 1.3 17-Jun-2022  rillig 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'.
 1.2 26-Sep-2021  rillig tests/lint: run all platform tests with the same options
 1.1 26-Sep-2021  rillig tests/lint: add tests for platform characteristics

Running lint in usr.bin/make on i386 fails due to this warning:

cond.c(800): warning: argument #3 is converted from 'unsigned char' to
'unsigned int' due to prototype [259]

This warning only occurred on i386 but not on sparc or x86_64. Try to
reproduce the test situation in platform_int.

The platform code in t_integration.sh was not strict enough, it didn't
check for multiple conditions, such as in msg_132_ilp32. That test was
only supposed to run on ILP32 platforms where size_t is unsigned int. It
also ran on sparc, even though size_t is long there.
 1.3 28-Jan-2024  rillig tests/lint: sort diagnostics in ilp32 tests chronologically
 1.2 27-Jan-2024  rillig lint: fix type of large integer constants
 1.1 27-Jan-2024  rillig tests/lint: test integer constants in different language levels
 1.3 28-Jan-2024  rillig tests/lint: sort diagnostics in ilp32 tests chronologically
 1.2 27-Jan-2024  rillig lint: fix type of large integer constants
 1.1 27-Jan-2024  rillig tests/lint: test integer constants in different language levels
 1.9 28-Jan-2025  rillig tests/lint: fix platform-specific tests for <ctype.h> usage

On arm (32-bit, ptrdiff_t is long), there was an extra warning that
didn't show up on i386 or x86_64.

After moving the test to the platform-specific tests, the i386 test shows
an additional warning about integer overflow. This is because the
platform-specific tests run with more lint warnings enabled than in
msg_341.c.
 1.8 30-Mar-2024  rillig branches: 1.8.2;
lint: do not convert array subscripts from size_t to ptrdiff_t

The C standards do not specify a fixed type for an array subscript, it
just has to be an integer type. Previously, query 4 fired for the
ubiquitous expression 'ptr[sz]' when sz had type 'size_t'.

The test platform_ilp32_long is unaffected by this change, as the
integer constant 0x80000000 has type 'unsigned int', while size_t is
'unsigned long' on those platforms, and even though the types 'unsigned
int' and 'unsigned long' have the same value space, there's still a
conversion, at least for now.
 1.7 30-Mar-2024  rillig lint: reword messages about array subscripts to sound more natural
 1.6 10-Mar-2024  rillig lint: add details to the message about integer overflow

Having only the operator was too unspecific to be actionable, so add the
actual numbers and the data type.
 1.5 10-Mar-2024  rillig lint: saturate signed integer overflow

In array address calculations, this prevents a 'array subscript cannot
be negative' for large array subscripts.
 1.4 09-Mar-2024  rillig tests/lint: demonstrate integer overflow on lp64 platforms
 1.3 09-Mar-2024  rillig tests/lint: test check for out-of-bounds array index
 1.2 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.1 27-Feb-2023  rillig lint: split platform-specific test for loss of accuracy

Lint distinguishes between platforms where size_t is unsigned int and
platforms where size_t is unsigned long.
 1.8.2.1 02-Aug-2025  perseant Sync with HEAD
 1.10 28-Jan-2025  rillig tests/lint: fix platform-specific tests for <ctype.h> usage

On arm (32-bit, ptrdiff_t is long), there was an extra warning that
didn't show up on i386 or x86_64.

After moving the test to the platform-specific tests, the i386 test shows
an additional warning about integer overflow. This is because the
platform-specific tests run with more lint warnings enabled than in
msg_341.c.
 1.9 30-Mar-2024  rillig branches: 1.9.2;
lint: reword messages about array subscripts to sound more natural
 1.8 10-Mar-2024  rillig lint: add details to the message about integer overflow

Having only the operator was too unspecific to be actionable, so add the
actual numbers and the data type.
 1.7 10-Mar-2024  rillig lint: saturate signed integer overflow

In array address calculations, this prevents a 'array subscript cannot
be negative' for large array subscripts.
 1.6 09-Mar-2024  rillig tests/lint: demonstrate integer overflow on lp64 platforms
 1.5 09-Mar-2024  rillig tests/lint: test check for out-of-bounds array index
 1.4 08-Jul-2023  rillig lint: do not use portable type sizes in integer constraints

This reverts the change from tree.c 1.547 from 2023-07-03. Back then, I
didn't know that the actual value from a type's 'portable size in bits'
was not supposed to be used.
 1.3 03-Jul-2023  rillig lint: consistently use portable type size in integer constraints

Since tree.c 1.546 from 2023-07-03, lint no longer warned about possible
loss of accuracy when converting from 'long' to 'int' on an ILP32
platform that uses 'unsigned long' for size_t, when run in portable mode
(-p), which is enabled by default in the NetBSD build.

The integer constraints avoid false-positive warnings by looking at the
actual values an expression can take. The function can_represent is
guarded by a condition that uses the portable_size_in_bits, but then
internally used the opposite size_in_bits, which led to inconsistent
results.

The warning looks confusing though, as on an ILP32 platform, 'int' and
'long' have the same size and representation, therefore there cannot be
an actual loss of accuracy. The warning may need to be reworded to
explicitly mention the portability mode, in which sizeof(int) is assumed
to be 3 instead of 4, to catch possible loss of accuracy on other
platforms.
 1.2 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.1 27-Feb-2023  rillig lint: split platform-specific test for loss of accuracy

Lint distinguishes between platforms where size_t is unsigned int and
platforms where size_t is unsigned long.
 1.9.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 07-Feb-2024  rillig tests/lint: sync test for integer constant type on ILP32 platforms

The test was broken since lex.c 1.214 from today.
 1.3 28-Jan-2024  rillig tests/lint: sort diagnostics in ilp32 tests chronologically
 1.2 27-Jan-2024  rillig lint: fix type of large integer constants
 1.1 27-Jan-2024  rillig tests/lint: test integer constants in different language levels
 1.6 09-Jul-2023  rillig lint: remove redundant '#' after 'argument' in diagnostics
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 16-Apr-2022  rillig tests/lint: fix tests on platforms other than x86_64

In msg_259_ilp32.c 1.6 from 2022-04-15, I removed the option -S from the
test in order to keep the message 259, but I forgot to fix the C99-style
comment as well.

In platform_int.c, the default lint option -S no longer generated
warning 259, so remove that option.
 1.3 26-Sep-2021  rillig tests/lint: explain difference between i386 and sparc for 259

Seen in usr.bin/make/cond.c 1.278 from 2021-09-21, line 800, the call to
is_token, where unsigned char gets converted to unsigned int or unsigned
long, depending on the platform.
 1.2 26-Sep-2021  rillig tests/lint: run all platform tests with the same options
 1.1 26-Sep-2021  rillig tests/lint: add tests for platform characteristics

Running lint in usr.bin/make on i386 fails due to this warning:

cond.c(800): warning: argument #3 is converted from 'unsigned char' to
'unsigned int' due to prototype [259]

This warning only occurred on i386 but not on sparc or x86_64. Try to
reproduce the test situation in platform_int.

The platform code in t_integration.sh was not strict enough, it didn't
check for multiple conditions, such as in msg_132_ilp32. That test was
only supposed to run on ILP32 platforms where size_t is unsigned int. It
also ran on sparc, even though size_t is long there.
 1.3 17-Jun-2022  rillig 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'.
 1.2 26-Sep-2021  rillig tests/lint: explain difference between i386 and sparc for 259

Seen in usr.bin/make/cond.c 1.278 from 2021-09-21, line 800, the call to
is_token, where unsigned char gets converted to unsigned int or unsigned
long, depending on the platform.
 1.1 26-Sep-2021  rillig tests/lint: add tests for platform characteristics

Running lint in usr.bin/make on i386 fails due to this warning:

cond.c(800): warning: argument #3 is converted from 'unsigned char' to
'unsigned int' due to prototype [259]

This warning only occurred on i386 but not on sparc or x86_64. Try to
reproduce the test situation in platform_int.

The platform code in t_integration.sh was not strict enough, it didn't
check for multiple conditions, such as in msg_132_ilp32. That test was
only supposed to run on ILP32 platforms where size_t is unsigned int. It
also ran on sparc, even though size_t is long there.
 1.7 10-Apr-2025  rillig lint: remove now-unnecessary CONSTCOND comments
 1.6 05-Jul-2023  rillig branches: 1.6.2;
tests/lint: spell platform identifiers for 'long double' consistently

The test file names don't have a hyphen, so the identifiers shouldn't
have one either.
 1.5 05-Apr-2023  rillig lint: fix duplicate warning when parsing big float constants
 1.4 05-Apr-2023  rillig tests/lint: demonstrate duplicate warning when parsing big floats
 1.3 22-Feb-2023  rillig tests/lint: add platform-specific tests
 1.2 26-Sep-2021  rillig tests/lint: run all platform tests with the same options
 1.1 26-Sep-2021  rillig tests/lint: add tests for platform characteristics

Running lint in usr.bin/make on i386 fails due to this warning:

cond.c(800): warning: argument #3 is converted from 'unsigned char' to
'unsigned int' due to prototype [259]

This warning only occurred on i386 but not on sparc or x86_64. Try to
reproduce the test situation in platform_int.

The platform code in t_integration.sh was not strict enough, it didn't
check for multiple conditions, such as in msg_132_ilp32. That test was
only supposed to run on ILP32 platforms where size_t is unsigned int. It
also ran on sparc, even though size_t is long there.
 1.6.2.1 02-Aug-2025  perseant Sync with HEAD
 1.3 17-Jun-2022  rillig 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'.
 1.2 26-Sep-2021  rillig tests/lint: run all platform tests with the same options
 1.1 26-Sep-2021  rillig tests/lint: add tests for platform characteristics

Running lint in usr.bin/make on i386 fails due to this warning:

cond.c(800): warning: argument #3 is converted from 'unsigned char' to
'unsigned int' due to prototype [259]

This warning only occurred on i386 but not on sparc or x86_64. Try to
reproduce the test situation in platform_int.

The platform code in t_integration.sh was not strict enough, it didn't
check for multiple conditions, such as in msg_132_ilp32. That test was
only supposed to run on ILP32 platforms where size_t is unsigned int. It
also ran on sparc, even though size_t is long there.
 1.6 10-Apr-2025  rillig lint: remove now-unnecessary CONSTCOND comments
 1.5 05-Jul-2023  rillig branches: 1.5.2;
tests/lint: spell platform identifiers for 'long double' consistently

The test file names don't have a hyphen, so the identifiers shouldn't
have one either.
 1.4 05-Apr-2023  rillig tests/lint: demonstrate duplicate warning when parsing big floats
 1.3 22-Feb-2023  rillig tests/lint: add platform-specific tests
 1.2 26-Sep-2021  rillig tests/lint: run all platform tests with the same options
 1.1 26-Sep-2021  rillig tests/lint: add tests for platform characteristics

Running lint in usr.bin/make on i386 fails due to this warning:

cond.c(800): warning: argument #3 is converted from 'unsigned char' to
'unsigned int' due to prototype [259]

This warning only occurred on i386 but not on sparc or x86_64. Try to
reproduce the test situation in platform_int.

The platform code in t_integration.sh was not strict enough, it didn't
check for multiple conditions, such as in msg_132_ilp32. That test was
only supposed to run on ILP32 platforms where size_t is unsigned int. It
also ran on sparc, even though size_t is long there.
 1.5.2.1 02-Aug-2025  perseant Sync with HEAD
 1.3 17-Jun-2022  rillig 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'.
 1.2 26-Sep-2021  rillig tests/lint: run all platform tests with the same options
 1.1 26-Sep-2021  rillig tests/lint: add tests for platform characteristics

Running lint in usr.bin/make on i386 fails due to this warning:

cond.c(800): warning: argument #3 is converted from 'unsigned char' to
'unsigned int' due to prototype [259]

This warning only occurred on i386 but not on sparc or x86_64. Try to
reproduce the test situation in platform_int.

The platform code in t_integration.sh was not strict enough, it didn't
check for multiple conditions, such as in msg_132_ilp32. That test was
only supposed to run on ILP32 platforms where size_t is unsigned int. It
also ran on sparc, even though size_t is long there.
 1.7 10-Apr-2025  rillig lint: remove now-unnecessary CONSTCOND comments
 1.6 05-Jul-2023  rillig branches: 1.6.2;
tests/lint: spell platform identifiers for 'long double' consistently

The test file names don't have a hyphen, so the identifiers shouldn't
have one either.
 1.5 05-Apr-2023  rillig lint: fix duplicate warning when parsing big float constants
 1.4 05-Apr-2023  rillig tests/lint: demonstrate duplicate warning when parsing big floats
 1.3 22-Feb-2023  rillig tests/lint: add platform-specific tests
 1.2 26-Sep-2021  rillig tests/lint: run all platform tests with the same options
 1.1 26-Sep-2021  rillig tests/lint: add tests for platform characteristics

Running lint in usr.bin/make on i386 fails due to this warning:

cond.c(800): warning: argument #3 is converted from 'unsigned char' to
'unsigned int' due to prototype [259]

This warning only occurred on i386 but not on sparc or x86_64. Try to
reproduce the test situation in platform_int.

The platform code in t_integration.sh was not strict enough, it didn't
check for multiple conditions, such as in msg_132_ilp32. That test was
only supposed to run on ILP32 platforms where size_t is unsigned int. It
also ran on sparc, even though size_t is long there.
 1.6.2.1 02-Aug-2025  perseant Sync with HEAD
 1.3 17-Jun-2022  rillig 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'.
 1.2 26-Sep-2021  rillig tests/lint: run all platform tests with the same options
 1.1 26-Sep-2021  rillig tests/lint: add tests for platform characteristics

Running lint in usr.bin/make on i386 fails due to this warning:

cond.c(800): warning: argument #3 is converted from 'unsigned char' to
'unsigned int' due to prototype [259]

This warning only occurred on i386 but not on sparc or x86_64. Try to
reproduce the test situation in platform_int.

The platform code in t_integration.sh was not strict enough, it didn't
check for multiple conditions, such as in msg_132_ilp32. That test was
only supposed to run on ILP32 platforms where size_t is unsigned int. It
also ran on sparc, even though size_t is long there.
 1.6 05-Nov-2024  rillig lint: fix cross references in comments
 1.5 28-Mar-2023  rillig branches: 1.5.2;
lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.3 26-Sep-2021  rillig tests/lint: explain difference between i386 and sparc for 259

Seen in usr.bin/make/cond.c 1.278 from 2021-09-21, line 800, the call to
is_token, where unsigned char gets converted to unsigned int or unsigned
long, depending on the platform.
 1.2 26-Sep-2021  rillig tests/lint: run all platform tests with the same options
 1.1 26-Sep-2021  rillig tests/lint: add tests for platform characteristics

Running lint in usr.bin/make on i386 fails due to this warning:

cond.c(800): warning: argument #3 is converted from 'unsigned char' to
'unsigned int' due to prototype [259]

This warning only occurred on i386 but not on sparc or x86_64. Try to
reproduce the test situation in platform_int.

The platform code in t_integration.sh was not strict enough, it didn't
check for multiple conditions, such as in msg_132_ilp32. That test was
only supposed to run on ILP32 platforms where size_t is unsigned int. It
also ran on sparc, even though size_t is long there.
 1.5.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.2 26-Sep-2021  rillig tests/lint: explain difference between i386 and sparc for 259

Seen in usr.bin/make/cond.c 1.278 from 2021-09-21, line 800, the call to
is_token, where unsigned char gets converted to unsigned int or unsigned
long, depending on the platform.
 1.1 26-Sep-2021  rillig tests/lint: add tests for platform characteristics

Running lint in usr.bin/make on i386 fails due to this warning:

cond.c(800): warning: argument #3 is converted from 'unsigned char' to
'unsigned int' due to prototype [259]

This warning only occurred on i386 but not on sparc or x86_64. Try to
reproduce the test situation in platform_int.

The platform code in t_integration.sh was not strict enough, it didn't
check for multiple conditions, such as in msg_132_ilp32. That test was
only supposed to run on ILP32 platforms where size_t is unsigned int. It
also ran on sparc, even though size_t is long there.
 1.19 15-May-2025  rillig lint: handle __attribute__ after a declarator
 1.18 15-May-2025  rillig lint: handle __attribute__ at the beginning of a declaration
 1.17 14-May-2025  rillig lint: accept '__attribute__((mode(TI)))' before 'unsigned'
 1.16 14-May-2025  rillig tests/lint: demonstrate missing __attribute__((mode(TI))) cases

Seen in compiler_rt/popcountti2.c.
 1.15 28-Jan-2025  rillig tests/lint: fix platform-specific tests for <ctype.h> usage

On arm (32-bit, ptrdiff_t is long), there was an extra warning that
didn't show up on i386 or x86_64.

After moving the test to the platform-specific tests, the i386 test shows
an additional warning about integer overflow. This is because the
platform-specific tests run with more lint warnings enabled than in
msg_341.c.
 1.14 30-Mar-2024  rillig branches: 1.14.2;
lint: do not convert array subscripts from size_t to ptrdiff_t

The C standards do not specify a fixed type for an array subscript, it
just has to be an integer type. Previously, query 4 fired for the
ubiquitous expression 'ptr[sz]' when sz had type 'size_t'.

The test platform_ilp32_long is unaffected by this change, as the
integer constant 0x80000000 has type 'unsigned int', while size_t is
'unsigned long' on those platforms, and even though the types 'unsigned
int' and 'unsigned long' have the same value space, there's still a
conversion, at least for now.
 1.13 30-Mar-2024  rillig lint: reword messages about array subscripts to sound more natural
 1.12 10-Mar-2024  rillig lint: add details to the message about integer overflow

Having only the operator was too unspecific to be actionable, so add the
actual numbers and the data type.
 1.11 10-Mar-2024  rillig lint: saturate signed integer overflow

In array address calculations, this prevents a 'array subscript cannot
be negative' for large array subscripts.
 1.10 10-Mar-2024  rillig tests/lint: enable test for integer overflow in array index
 1.9 09-Mar-2024  rillig tests/lint: demonstrate integer overflow on lp64 platforms
 1.8 09-Mar-2024  rillig tests/lint: test check for out-of-bounds array index
 1.7 08-Jul-2023  rillig lint: warn about conversion from 128-bit to smaller integer types
 1.6 08-Jul-2023  rillig tests/lint: demonstrate missing warning for converting int128_t
 1.5 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.4 22-Feb-2023  rillig tests/lint: add platform-specific tests
 1.3 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.2 26-Sep-2021  rillig tests/lint: run all platform tests with the same options
 1.1 26-Sep-2021  rillig tests/lint: add tests for platform characteristics

Running lint in usr.bin/make on i386 fails due to this warning:

cond.c(800): warning: argument #3 is converted from 'unsigned char' to
'unsigned int' due to prototype [259]

This warning only occurred on i386 but not on sparc or x86_64. Try to
reproduce the test situation in platform_int.

The platform code in t_integration.sh was not strict enough, it didn't
check for multiple conditions, such as in msg_132_ilp32. That test was
only supposed to run on ILP32 platforms where size_t is unsigned int. It
also ran on sparc, even though size_t is long there.
 1.14.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 17-Jun-2022  rillig 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'.
 1.3 11-Jun-2022  rillig lint: add quotes around a few more placeholders in messages
 1.2 26-Sep-2021  rillig tests/lint: run all platform tests with the same options
 1.1 26-Sep-2021  rillig tests/lint: add tests for platform characteristics

Running lint in usr.bin/make on i386 fails due to this warning:

cond.c(800): warning: argument #3 is converted from 'unsigned char' to
'unsigned int' due to prototype [259]

This warning only occurred on i386 but not on sparc or x86_64. Try to
reproduce the test situation in platform_int.

The platform code in t_integration.sh was not strict enough, it didn't
check for multiple conditions, such as in msg_132_ilp32. That test was
only supposed to run on ILP32 platforms where size_t is unsigned int. It
also ran on sparc, even though size_t is long there.
 1.3 28-Jan-2024  rillig tests/lint: sort multiple diagnostics per line chronologically

For now, the chronologic order is not enforced but has to be established
manually, for example by removing all 'expect' comment lines and
regenerating them with 'accept.sh -u'.

While here, clean up a few instances that came up when regenerating the
'expect' comments, such as wrong indentation or needless deviation from
the 'expect+1' form.
 1.2 27-Jan-2024  rillig lint: fix type of large integer constants
 1.1 27-Jan-2024  rillig tests/lint: test integer constants in different language levels
 1.3 28-Jan-2024  rillig tests/lint: sort multiple diagnostics per line chronologically

For now, the chronologic order is not enforced but has to be established
manually, for example by removing all 'expect' comment lines and
regenerating them with 'accept.sh -u'.

While here, clean up a few instances that came up when regenerating the
'expect' comments, such as wrong indentation or needless deviation from
the 'expect+1' form.
 1.2 27-Jan-2024  rillig lint: fix type of large integer constants
 1.1 27-Jan-2024  rillig tests/lint: test integer constants in different language levels
 1.4 07-Feb-2024  rillig lint: unify rules for determining the type of an integer constant

Previously, in traditional C mode, large decimal numbers were treated as
unsigned, which disagreed with the book from 1978.
 1.3 28-Jan-2024  rillig tests/lint: sort multiple diagnostics per line chronologically

For now, the chronologic order is not enforced but has to be established
manually, for example by removing all 'expect' comment lines and
regenerating them with 'accept.sh -u'.

While here, clean up a few instances that came up when regenerating the
'expect' comments, such as wrong indentation or needless deviation from
the 'expect+1' form.
 1.2 27-Jan-2024  rillig lint: fix type of large integer constants
 1.1 27-Jan-2024  rillig tests/lint: test integer constants in different language levels
 1.7 07-Apr-2025  rillig lint: remove warning about 'constant in conditional context'

This makes the '-X 161' option to lint invalid.
 1.6 08-Jun-2024  rillig branches: 1.6.2;
lint: add details to warnings about negative constant to unsigned
 1.5 02-Dec-2023  rillig tests/lint: add more test cases for nonportable character comparison
 1.4 22-Feb-2023  rillig lint: fix confusing message about nonportable character constants
 1.3 22-Feb-2023  rillig tests/lint: add platform-specific tests
 1.2 26-Sep-2021  rillig tests/lint: run all platform tests with the same options
 1.1 26-Sep-2021  rillig tests/lint: add tests for platform characteristics

Running lint in usr.bin/make on i386 fails due to this warning:

cond.c(800): warning: argument #3 is converted from 'unsigned char' to
'unsigned int' due to prototype [259]

This warning only occurred on i386 but not on sparc or x86_64. Try to
reproduce the test situation in platform_int.

The platform code in t_integration.sh was not strict enough, it didn't
check for multiple conditions, such as in msg_132_ilp32. That test was
only supposed to run on ILP32 platforms where size_t is unsigned int. It
also ran on sparc, even though size_t is long there.
 1.6.2.1 02-Aug-2025  perseant Sync with HEAD
 1.3 17-Jun-2022  rillig 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'.
 1.2 26-Sep-2021  rillig tests/lint: run all platform tests with the same options
 1.1 26-Sep-2021  rillig tests/lint: add tests for platform characteristics

Running lint in usr.bin/make on i386 fails due to this warning:

cond.c(800): warning: argument #3 is converted from 'unsigned char' to
'unsigned int' due to prototype [259]

This warning only occurred on i386 but not on sparc or x86_64. Try to
reproduce the test situation in platform_int.

The platform code in t_integration.sh was not strict enough, it didn't
check for multiple conditions, such as in msg_132_ilp32. That test was
only supposed to run on ILP32 platforms where size_t is unsigned int. It
also ran on sparc, even though size_t is long there.
 1.6 07-Apr-2025  rillig lint: remove warning about 'constant in conditional context'

This makes the '-X 161' option to lint invalid.
 1.5 08-Jun-2024  rillig branches: 1.5.2;
lint: add details to warnings about negative constant to unsigned
 1.4 02-Dec-2023  rillig tests/lint: add more test cases for nonportable character comparison
 1.3 22-Feb-2023  rillig tests/lint: add platform-specific tests
 1.2 26-Sep-2021  rillig tests/lint: run all platform tests with the same options
 1.1 26-Sep-2021  rillig tests/lint: add tests for platform characteristics

Running lint in usr.bin/make on i386 fails due to this warning:

cond.c(800): warning: argument #3 is converted from 'unsigned char' to
'unsigned int' due to prototype [259]

This warning only occurred on i386 but not on sparc or x86_64. Try to
reproduce the test situation in platform_int.

The platform code in t_integration.sh was not strict enough, it didn't
check for multiple conditions, such as in msg_132_ilp32. That test was
only supposed to run on ILP32 platforms where size_t is unsigned int. It
also ran on sparc, even though size_t is long there.
 1.5.2.1 02-Aug-2025  perseant Sync with HEAD
 1.3 17-Jun-2022  rillig 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'.
 1.2 26-Sep-2021  rillig tests/lint: run all platform tests with the same options
 1.1 26-Sep-2021  rillig tests/lint: add tests for platform characteristics

Running lint in usr.bin/make on i386 fails due to this warning:

cond.c(800): warning: argument #3 is converted from 'unsigned char' to
'unsigned int' due to prototype [259]

This warning only occurred on i386 but not on sparc or x86_64. Try to
reproduce the test situation in platform_int.

The platform code in t_integration.sh was not strict enough, it didn't
check for multiple conditions, such as in msg_132_ilp32. That test was
only supposed to run on ILP32 platforms where size_t is unsigned int. It
also ran on sparc, even though size_t is long there.
 1.36 14-Sep-2025  rillig lint: add more type details to several messages

In most expressions, the integer promotions are performed on the
operands, making the actual type different from the "visible" type of an
operand. To properly explain the situation, mention the type before the
integer promotions in case it differs from the resulting type.
 1.35 12-Apr-2025  rillig lint: s/illegal/invalid/g

Lint does not provide legal advice.
 1.34 20-Feb-2025  rillig lint: mention the assignment operator in 'illegal combination'

In source lines that contain both a 'return' statement as well as a
function-like macro, such as the C11 atomics, seeing the word 'init' in
the diagnostic helps to see that the type conflict is not in the
'return' statement but instead in some initializer.

Seen in userspace-rcu/wfcqueue.h:147.
 1.33 30-Nov-2024  rillig tests/lint: add a few more tests to increase code coverage
 1.32 29-Nov-2024  rillig lint: in a query, treat 00 as an octal integer constant

Even though the value of the constant is 0 and thus the same as in the
decimal interpretation, it is syntactically an octal number and contains
a redundant leading digit, which may be interesting to detect.
 1.31 28-Nov-2024  rillig lint: add queries for typedefs to struct/union and their pointers

As suggested in share/misc/style since 1.75 from August 2023.

These are queries instead of warnings as the number of false positives or
historical practice is too high; these queries are only intended for
detecting these typedefs on newly added types.
 1.30 23-Nov-2024  rillig lint: add details to messages about discarding qualifiers

The related message 153 is left as-is, as it is used in two places, and
the second place is not only about discarded qualifiers.
 1.29 27-Apr-2024  rillig branches: 1.29.2;
lint: converting a null pointer to another pointer type is not narrowing
 1.28 27-Apr-2024  rillig lint: add query for conversion from void pointer to other pointer
 1.27 30-Mar-2024  rillig lint: in the query about implicit conversions, ignore casts
 1.26 30-Mar-2024  rillig lint: add query for implicit integer-to-floating conversion
 1.25 30-Mar-2024  rillig lint: do not convert array subscripts from size_t to ptrdiff_t

The C standards do not specify a fixed type for an array subscript, it
just has to be an integer type. Previously, query 4 fired for the
ubiquitous expression 'ptr[sz]' when sz had type 'size_t'.

The test platform_ilp32_long is unaffected by this change, as the
integer constant 0x80000000 has type 'unsigned int', while size_t is
'unsigned long' on those platforms, and even though the types 'unsigned
int' and 'unsigned long' have the same value space, there's still a
conversion, at least for now.
 1.24 02-Feb-2024  rillig tests/lint: test lexing of characters and strings
 1.23 28-Jan-2024  rillig tests/lint: enforce diagnostics to be listed in chronologic order

While here, fix the tests on uchar platforms.
 1.22 20-Jan-2024  rillig lint: add query for const automatic variables
 1.21 07-Jan-2024  rillig lint: allow querying for invisible characters in literals and constants
 1.20 10-Dec-2023  rillig lint: allow querying for 'static' followed by non-'static' declaration
 1.19 03-Jul-2023  rillig tests/lint: move platform-specific query tests to separate files

This fixes the tests on 'unsigned char' platforms.

Thanks martin@ for the notification.
 1.18 30-Jun-2023  rillig lint: add query for assigning an integer 0 to a pointer
 1.17 24-Jun-2023  rillig lint: add query for comparing 'char' with plain integers
 1.16 24-Jun-2023  rillig lint: add query for redundant 'extern' in function declaration
 1.15 22-Jun-2023  rillig lint: add query for comma operator
 1.14 03-Jun-2023  rillig lint: add query for static variables in functions

This query allows finding hidden global variables, as an easier-to-read
alternative to 'objdump -t'.
 1.13 13-May-2023  rillig lint: add query for chained assignments
 1.12 15-Apr-2023  rillig lint: add query for parenthesized return value
 1.11 31-Mar-2023  rillig lint: allow querying for octal integer constants
 1.10 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.9 15-Jan-2023  rillig tests/lint: document conversion from void pointer
 1.8 08-Jan-2023  rillig lint: do not report usual arithmetic conversions for constants
 1.7 08-Jan-2023  rillig lint/tests: test query for usual arithmetic conversions
 1.6 24-Sep-2022  rillig tests/lint: fix test for queries on platforms where char is unsigned

error: queries.c(118): missing /* expect+1: implicit conversion
changes sign from 'char' to 'int' [Q3] */
error: queries.c(122): missing /* expect+1: implicit conversion
changes sign from 'char' to 'int' [Q3] */
 1.5 10-Sep-2022  rillig tests/lint: fix test for queries on platforms where char is unsigned

These platforms reported an additional "implicit conversion changes
sign" in lines 105, 105, 118, 122.
 1.4 28-Aug-2022  rillig lint: rename dcs manipulation functions to be clearer

No functional change.
 1.3 08-Jul-2022  rillig lint: fix edge cases in the query for redundant cast before assignment

Casting from and to _Bool is only allowed outside strict bool mode.
Outside strict bool mode, _Bool is an integer type, therefore return
early if any of the operands has type _Bool. In strict bool mode, even
casting from _Bool to _Bool is not allowed, as it is not needed in
practice.

Handle _Complex types before real floating-point types. Return early
for _Complex types, as these are floating-point types as well.

For pointer casts, not only flag casts to or from 'pointer to void', but
also casts between the same types.

In debug mode, when constructing the type '_Complex float', the type
name of '_Complex' occurs in the debug log. Outside of debug mode,
printing this type name is an error since this type keyword only occurs
internally, when constructing a type. At that point, it is not supposed
to occur in any user-visible message.
 1.2 08-Jul-2022  rillig lint: fix query for redundant cast before assignment

Previously, 'i = (int)dbl' was marked as redundant, even though it
performs a value conversion.
 1.1 05-Jul-2022  rillig lint: add additional queries that are not enabled by default

In the last 18 months, several lint warnings have been made adjusted to
allow common usage patterns. For example, lint no longer warns about a
constant condition in the statement 'do { ... } while (false)' (message
161), as this pattern is well-known in statement-like macros, making it
unlikely that the 'false' is a mistake. Another example is casts
between unequal pointer types (message 247) for a few well-known
patterns that are unlikely to be bugs.

Occasionally, it is useful to query the code for patterns or events that
would not justify a warning. These patterns are modeled as predefined
queries that can be selected individually, in addition to and
independently of the existing warnings and errors.

New queries can be added as needed, in the same way as new warnings.
Queries that are deemed no longer used can be deactivated in the same
way as warnings that are no longer used.

As long as none of the queries is enabled, they produce a minimal
overhead of querying a single global variable. Computations that are
more expensive than a few machine instructions should be guarded by
any_query_enabled.

https://mail-index.netbsd.org/source-changes-d/2022/06/28/msg013716.html

ok christos@
 1.29.2.1 02-Aug-2025  perseant Sync with HEAD
 1.2 28-Jan-2024  rillig tests/lint: enforce diagnostics to be listed in chronologic order

While here, fix the tests on uchar platforms.
 1.1 03-Jul-2023  rillig tests/lint: move platform-specific query tests to separate files

This fixes the tests on 'unsigned char' platforms.

Thanks martin@ for the notification.
 1.2 28-Jan-2024  rillig tests/lint: enforce diagnostics to be listed in chronologic order

While here, fix the tests on uchar platforms.
 1.1 03-Jul-2023  rillig tests/lint: move platform-specific query tests to separate files

This fixes the tests on 'unsigned char' platforms.

Thanks martin@ for the notification.
 1.4 07-Jul-2023  rillig 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.3 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.2 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.1 19-Jun-2021  rillig lint: fix assertion after malformed for loop

Found using afl.
 1.3 17-Jun-2022  rillig 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'.
 1.2 15-Jan-2022  rillig tests/lint: expect complete messages in feature tests

Previously, the tests contained many comments like /* expect: 123 */,
which were useless to a casual reader since nobody is expected to learn
lint's message IDs by heart. Replace these with the complete
diagnostics, to show what lint is complaining about.

The tests named msg_*.c have been left unmodified since they mention the
full message text in their header comment.

No functional change.
 1.1 19-Jun-2021  rillig lint: fix assertion after malformed for loop

Found using afl.
 1.3 07-Jul-2023  rillig 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.2 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.1 14-Jul-2021  rillig tests/lint: add several tests for edge cases in the grammar
 1.2 17-Jun-2022  rillig 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'.
 1.1 14-Jul-2021  rillig tests/lint: add several tests for edge cases in the grammar
 1.3 28-Mar-2023  rillig lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
 1.2 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.1 11-Jul-2021  rillig tests/lint: test dangling else
 1.2 17-Jun-2022  rillig 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'.
 1.1 11-Jul-2021  rillig tests/lint: test dangling else
 1.85 03-Jan-2025  rillig tests/lint: run lint1 tests in one fell swoop

This generates fewer details in the ATF test reports, as the
platform-specific tests that are skipped are not mentioned individually.
 1.84 08-Jun-2024  rillig branches: 1.84.2;
tests/lint: remove unused lint1-skip-if selector
 1.83 02-Feb-2024  rillig tests/lint: test UTF-8 mode
 1.82 05-Jul-2023  rillig tests/lint: spell platform identifiers for 'long double' consistently

The test file names don't have a hyphen, so the identifiers shouldn't
have one either.
 1.81 24-Jun-2023  rillig tests/lint: allow accept.sh to override lint1 for local testing
 1.80 22-May-2023  rillig tests/lint1: allow whitespace in files containing the expected output

This reduces the amount of wizardry needed to interpret the files. For
a more gentle introduction of the file format, see ../lint2/msg_000.ln.

The whitespace that is removed is very similar to the one in the lint2
tests, the difference is that '%<space>' and '%#' need to be preserved
in abbreviated printf and scanf format strings.
 1.79 10-Apr-2023  rillig tests/lint: demonstrate wrong warning with complex numbers
 1.78 06-Feb-2023  rillig tests/lint: sync reference to platform properties generator
 1.77 06-Feb-2023  rillig lint: eliminate unnecessary indirection

No functional change.
 1.76 17-Jun-2022  rillig 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'.
 1.75 26-Feb-2022  rillig lint: fix memory corruption in statement expressions (since 2021-12-17)

The commit that introduced the assertion failure looks innocent, it only
adds a few predefined functions for GCC mode. Nevertheless, before that
commit, lint consistently complained about 'error: void type illegal in
expression [109]', which doesn't make sense either.

This fix also removes the creative use of the initialization stack to
store the type of the statement expression. Having a separate stack for
these statement expressions makes the code easier to understand.
 1.74 26-Feb-2022  rillig tests/lint: demonstrate assertion failure in GCC compound expression
 1.73 10-Oct-2021  rillig tests/lint: remove duplicate platform, generate platforms list

It was an unreliable idea to extract the platform properties from the
targparam.h files manually, even if it was a one-time job. I still made
a mistake by accidentally marking aarch64 as schar, even though it is
uchar, plus I duplicated the line for powerpc64.

Remove the duplicate line, no functional change.
 1.72 10-Oct-2021  skrll aarch64 has unsigned char
 1.71 26-Sep-2021  rillig tests/lint: add tests for platform characteristics

Running lint in usr.bin/make on i386 fails due to this warning:

cond.c(800): warning: argument #3 is converted from 'unsigned char' to
'unsigned int' due to prototype [259]

This warning only occurred on i386 but not on sparc or x86_64. Try to
reproduce the test situation in platform_int.

The platform code in t_integration.sh was not strict enough, it didn't
check for multiple conditions, such as in msg_132_ilp32. That test was
only supposed to run on ILP32 platforms where size_t is unsigned int. It
also ran on sparc, even though size_t is long there.
 1.70 10-Sep-2021  rillig lint: replace space followed by tab with simply tab

No functional change.
 1.69 21-Aug-2021  rillig tests/lint: guard against typos in test environment configuration

Some tests had "lint1-only-if" without a trailing colon, others included
the trailing colon. The tests that included the trailing colon were run
even though they were supposed to be skipped, and they failed, as could
be expected.

To prevent further typos, always require the trailing colon, just as in
"lint1-flags" and fail fast on unknown "lint1" comments.
 1.68 13-Jul-2021  rillig tests/lint: take archsubdir from usr.bin/xlint/Makefile.inc

This fixes the tests on the various ARM platforms where the platform
name does not correspond to MACHINE_ARCH, such as earmv7hf.
 1.67 11-Jul-2021  rillig tests/lint: rework ATF test driver

To skip tests that work only on particular platforms, a simple 'eval'
from the shell does not work since it does not exit on failure. Fix
this by storing the commands in a local variable first.

Remove configuration knobs 'lint1-only-if-arch' and 'lint1-skip-if-arch'
since they are unused.

When skipping a test, actually mark it as skipped in the ATF statistics.
 1.66 29-Jun-2021  rillig tests/lint: add test that only runs where char == unsigned char

There a 4 regular NetBSD builds where lint is activated. All these
builds run on platforms where char == signed char.

The official test runs from https://releng.netbsd.org/test-results.html
mostly have char == signed char as well.

However, lint behaves differently on platforms with char == unsigned
char. On these platforms, a simple "char ch = '\xff'" leads to the
bogus warning that "conversion of 'int' to 'char' is out of range".
 1.65 29-Jun-2021  rillig tests/lint: add tests for ILP32 platforms

Previously, all tests for lint had to produce the exact same output, no
matter which platform they ran on. This differs from practical needs
since lint is intended to produce different results depending on whether
the platform is ILP32 or LP64.

Examples for these are type conversions and the widths of the integer
types during lexical analysis.
 1.64 29-Jun-2021  rillig tests/lint: allow tests to be skipped depending on platform properties
 1.63 27-Jun-2021  rillig tests/lint: fix selection of the .exp-ln file

Since t_integration.sh 1.58 from today, the expected .ln output was not
detected anymore. Changes to the file format would have gone unnoticed.
 1.62 27-Jun-2021  rillig tests/lint: remove list of test names from t_integration

By convention, each *.c file in the source directory is a test case.

There is no need to list them individually and redundantly.

There is also no need to group the tests for the individual messages.
This ensures that each test is run in the regular builds. Previously,
the test all_messages stopped after the first failure.
 1.61 27-Jun-2021  rillig lint: require C11 for _Generic

This does not have any effect in practice since the option -g
(originally meant for GCC extensions to the C standards) implicitly
allows all features from C11, since err.c 1.111 from 2021-04-14.

Since the default lint flags for NetBSD builds include the option -g,
this allows all C11 features.

Currently it is not possible to say "allow GNU extensions but not C11".
 1.60 27-Jun-2021  rillig lint: fix option -Ac11, add test for _Generic

Previously, selecting the option -Ac11 allowed features from C11 but at
the same time prohibited 'long long', which was added in C99. This was
caused by the option -s, which is interpreted as "allow features from
C90, but no later".

The test for _Generic, which has been added in C11, demonstrates that
the current implementation is broken. Lint currently thinks that the
return type of a _Generic selection is the type of the expression, but
it really is the type of the selected expression. In the current tests,
this is always 'const char *', but C11 does not require that the types
of a generic selection are compatible.
 1.59 27-Jun-2021  rillig tests/lint: allow skipping individual tests

Depending on the platform, some tests do not make sense or produce
platform-dependent results. Allow these tests to be marked as such.

For example, the test lex_integer.c only works on 64-bit platforms.
Therefore it is disabled on i386 for now since it prints different
warnings there. Even better would be a "lint1-only-on-lpi32" toggle,
but that would need detection of 'sizeof(int)' at runtime.
 1.58 27-Jun-2021  rillig tests/lint: rename expected .ln file to .exp-ln

This way, the hack for suffixes is no longer needed.
 1.57 20-Jun-2021  rillig tests/lint: test syntax error in initialization using designator

This test prepares the upcoming refactoring of the grammar.
 1.56 19-Jun-2021  rillig lint: fix endless loop on unfinished comment at EOF

Found using afl.
 1.55 19-Jun-2021  rillig lint: fix assertion after malformed for loop

Found using afl.
 1.54 19-Jun-2021  rillig lint: fix assertion failure in struct with unnamed member

Found using afl.
 1.53 19-Jun-2021  rillig tests/lint: add test cases for lexical analysis
 1.52 16-Jun-2021  rillig tests/lint: sort the list of test cases

No functional change.
 1.51 16-Jun-2021  rillig tests/lint: clean up ATF test driver

No functional change.
 1.50 16-May-2021  rillig lint: add more specific warning for bit-field of type plain 'int'

Previously, declaring a bit-field of type plain 'int' resulted in this
warning:

warning: nonportable bit-field type 'int' [34]

This warning was too unspecific to be actionable, and until yesterday it
didn't even include the type. In order to allow this warning to be
understood and properly fixed, describe the actual nonportability more
precisely:

warning: bit-field of type plain 'int' has
implementation-defined signedness [344]
 1.49 14-May-2021  rillig tests/lint: test bitwise mismatch in switch statement
 1.48 03-May-2021  rillig branches: 1.48.2;
tests/lint: remove outdated comment

The test d_gcc_extension is already activated in line 121.
 1.47 02-May-2021  rillig tests/lint: add test for bit-field types in GCC mode
 1.46 02-May-2021  rillig tests/lint: demonstrate missing support for __packed __aligned
 1.45 30-Apr-2021  rillig tests/lint: add very basic tests for GCC __attribute__
 1.44 22-Apr-2021  rillig tests/lint: add test for typeof after statement

Found by christos@.
 1.43 18-Apr-2021  rillig lint: test emitting of symbol information in the .ln files

Even though the new test is quite large, it didn't find any bugs in the
code. The only thing I'm unsure about is why static functions are
exported as well, since they are supposed to be local to the translation
unit.
 1.42 17-Apr-2021  rillig tests/lint: demonstrate assertion failure in initialization
 1.41 14-Apr-2021  rillig lint: add test for newly added message about static array size
 1.40 08-Apr-2021  rillig lint: in code from included files, print stack trace

Previously, the standard NetBSD build generated several lint warnings in
lhash.h from OpenSSL, without providing any hint as to which file
actually included that header. In cases like these, lint now interprets
the line number information in the preprocessor output from GCC to
reconstruct the exact include path to the file in question.

The program check-expect.lua had to be rewritten almost completely since
it assumed that all diagnostics would come from the main file. In all
existing tests, this was true, but these tests did not cover all cases
that occurred in practice. Now it records the complete location of the
diagnostic instead of just the line number.
 1.39 05-Apr-2021  rillig lint: warn about for wrong type cast in argument to ctype.h functions

The argument to most of the functions from <ctype.h> "shall either be
representable as an 'unsigned char' or shall equal the value of the
macro EOF".

When confronted with the infamous warning 'array subscript has type
char', there are enough programmers who don't know the background of
that warning and thus fix it in a wrong way. Neither GCC nor Clang
explain its warning to target these programmers.

Both GCC and Clang warn about 'array subscript has type char', but they
ignore the other requirements of the <ctype.h> functions, even though
these are in the C standard library.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94182
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95177
https://stackoverflow.com/a/60696378
 1.38 02-Apr-2021  rillig tests/lint: prevent typo from tree.c 1.264 from happening again
 1.37 28-Mar-2021  rillig lint: remove wrong warning about wrong initializer type

The following code is valid:

int valid = {{{ 3 }}};

C90 3.5.7 and C99 6.7.8 both say that the "initializer for a scalar
shall be a single expression, optionally enclosed in braces". They
don't put any upper bound on the amount of braces, not even in the
"Translation limits" section.
 1.36 27-Mar-2021  rillig tests/lint: move description of tests into the tests themselves

In most cases the descriptions didn't add much to the test name anyway.
 1.35 27-Mar-2021  rillig tests/lint: do not force tests to start with 'd_'

Using only parts of the test name files in t_integration.sh made it
unnecessarily difficult to find a test based on its filename. The tests
for the individual messages already have a different prefix.

No functional change.
 1.34 23-Mar-2021  rillig tests/lint: test initialization using string literals

The errors in line 74 and 75 of the test are wrong. Everything is fine
there. The bug lies in init_array_using_string, try to see if you can
spot it, neither GCC 9.3.0 nor Clang 8.0.1 could.
 1.33 07-Mar-2021  rillig lint: in strict C mode, warn about initialization with '[a ... b]'

https://gcc.gnu.org/onlinedocs/gcc/Case-Ranges.html
 1.32 28-Feb-2021  rillig lint: fix null pointer dereference on parse error

Fixes PR bin/22119.
 1.31 28-Feb-2021  rillig lint: add test to demonstrate that PR bin/20264 has been fixed
 1.30 21-Feb-2021  rillig lint: add another test for C99 initializers
 1.29 19-Feb-2021  rillig lint: warn about mismatch in getopt handling
 1.28 18-Jan-2021  rillig lint: clean up code (mostly comments)
 1.27 17-Jan-2021  rillig lint: add more tests for system headers in strict bool mode
 1.26 14-Jan-2021  rillig lint: add tests for newly added messages for strict bool mode
 1.25 10-Jan-2021  rillig lint: allow custom flags to be specified in all unit tests

Previously, only the tests called msg_*.c could use this feature. Since
it is useful for other tests as well, enable it everywhere.
 1.24 10-Jan-2021  rillig lint: add test for triggering assertion failures in lint1
 1.23 10-Jan-2021  rillig lint: add test for treating _Bool as non-scalar type

This strict mode is not yet implemented. The plan is to use it for
usr.bin/make, to get rid of the many possible variants of defining the
Boolean type in make.h. These variants did find some bugs, but not
reliably so. Using static analysis seems more promising for this.

In an early stage of developing this test, lint1 crashed in the enum
definition in line 213, where the node for the '?:' had been NULL. This
can happen in other situations as well, such as with syntax errors, but
these should be rare, as lint is usually only run if the compiler has
accepted the source code. Still, there should not be any assertion
failures while running lint1.
 1.22 10-Jan-2021  rillig lint: demonstrate wrong handling of conversion to _Bool
 1.21 09-Jan-2021  rillig lint: allow tests to specify additional flags

Several of the tests only need to add the -p flag. Mentioning the
(current) default flags in each of these tests is redundant. Therefore,
allow them to specify "lint1-extra-flags: -p" instead of the current
"lint1-flags: -g -S -w -p".
 1.20 02-Jan-2021  rillig lint: fix integration test

The body of an ATF test must never return 1 but instead report failure
via atf_fail. Otherwise the following error message appears:

Failed: Test case body returned a non-ok exit code, but this is
not allowed

The test program t_integration intentionally bypasses the official ATF
API for performance reasons. But even then, it should stick to the API
as close as possible.
 1.19 02-Jan-2021  rillig lint: demonstrate that -t mode is practically unusable

Since main1.c from 2014-04-18, running lint in -t mode produces strange
warnings in lines 1 to 3 of no file at all.

This is caused by the builtins that are parsed in main(). These
builtins are incompatible with traditional mode because they use long
double, which had not been known at that time.
 1.18 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.17 01-Jan-2021  rillig lint: demonstrate bug in handling of nested C9X struct initializers
 1.16 01-Jan-2021  rillig lint: fix segmentation fault when checking returned enum types (211)
 1.15 31-Dec-2020  rillig lint: check that in "if (cond)", cond is scalar
 1.14 30-Dec-2020  rillig lint: remove a bit of redundancy from the test suite
 1.13 30-Dec-2020  rillig lint: add test for old style function arguments
 1.12 28-Dec-2020  rillig lint1: remove redundant description from tests
 1.11 28-Dec-2020  rillig lint1: add forgotten tests
 1.10 28-Dec-2020  rillig lint1: use tabular layout for listing the test cases
 1.9 28-Dec-2020  rillig lint1: remove redundancy from test definitions

Whether a test is supposed to produce lint warnings is determined by the
corresponding .exp file. There is no need to encode this information
redundantly in the test driver.
 1.8 28-Dec-2020  rillig lint1: enable test cvt_constant

This test had never been enabled. In t_integration.sh 1.3 from
2014-04-17 it was supposed to be enabled, but due to a line continuation
backslash, the words "test_case check_valid" ended up as the description
of the previous test, cvt_in_ternary.

While here, add the expected test output for d_struct_init_nested to
FILES.
 1.7 28-Dec-2020  rillig lint1: add test for initializing nested structs

Discovered in var.c 1.774 from 2020-12-28.
 1.6 28-Dec-2020  rillig lint: for tests with output, ensure that the output matches
 1.5 25-Jun-2020  jruoho Reference PRs consistently.
 1.4 21-Apr-2014  christos disable the extension test for now.
 1.3 17-Apr-2014  christos add more tests
 1.2 04-Feb-2014  njoly branches: 1.2.2;
Handle another declaration after statement case for lint in c99 mode.
Add the corresponding testcase.
 1.1 17-Mar-2012  jruoho branches: 1.1.2; 1.1.4;
Deprecate tests/util.
 1.1.4.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.2.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 17-Mar-2012  yamt file t_integration.sh was added on branch yamt-pagecache on 2012-04-17 00:09:23 +0000
 1.2.2.1 10-Aug-2014  tls Rebase.
 1.48.2.1 31-May-2021  cjep sync with head
 1.84.2.1 02-Aug-2025  perseant Sync with HEAD
 1.28 31-Aug-2025  rillig lint: check for mismatches in snprintb conversions

Seen in sh3/dmacreg.h, SH3_DMAC_CHCR_BITS.
 1.27 08-Dec-2024  rillig lint: warn about do-while macros that end with a semicolon
 1.26 01-Dec-2024  rillig lint: warn about function definitions that still use identifier lists
 1.25 28-Nov-2024  rillig lint: add queries for typedefs to struct/union and their pointers

As suggested in share/misc/style since 1.75 from August 2023.

These are queries instead of warnings as the number of false positives or
historical practice is too high; these queries are only intended for
detecting these typedefs on newly added types.
 1.24 23-Nov-2024  rillig lint: use separate message when discarding a qualifier in call
 1.23 10-Jul-2024  rillig lint: add warning for '!(var = constant)'

This catches expressions like 'ATF_CHECK(errno = ENOENT)', which was
intended to use '==' instead of '='.
 1.22 09-Jun-2024  rillig branches: 1.22.2;
lint: warn about lossy floating point constant to integer conversions
 1.21 11-May-2024  rillig lint: warn when comparing an integer to a floating point constant
 1.20 27-Apr-2024  rillig lint: add query for conversion from void pointer to other pointer
 1.19 30-Mar-2024  rillig lint: add query for implicit integer-to-floating conversion
 1.18 03-Mar-2024  rillig lint: check for unreachable bits and fields in snprintb formats

While here, clean up a few existing checks.
 1.17 02-Mar-2024  rillig lint: check snprintb formats for overlapping bits and fields
 1.16 01-Mar-2024  rillig lint: test format strings from snprintb calls

The functions snprintb and snprintb_m are specific to NetBSD, and their
format strings are tricky to get correct. Provide some assistance in
catching the most common mistakes.
 1.15 03-Feb-2024  rillig lint: warn about short octal escape followed by '8' or '9'

These mistakes is typically found in snprintb format directives but is
probably a typo everywhere else as well.
 1.14 20-Jan-2024  rillig lint: add query for const automatic variables
 1.13 07-Jan-2024  rillig lint: allow querying for invisible characters in literals and constants
 1.12 10-Dec-2023  rillig lint: allow querying for 'static' followed by non-'static' declaration
 1.11 03-Aug-2023  rillig lint: make '_Static_assert' only available in C11 or C23 mode
 1.10 02-Jul-2023  rillig lint: add initial support for C23

Required by xsrc/external/mit/MesaLib.old, brw_eu_validate.c, which
initializes a struct using empty braces: 'return (struct string){};'.
 1.9 30-Jun-2023  rillig lint: add query for assigning an integer 0 to a pointer
 1.8 28-Jun-2023  rillig tests/lint: use standard form of ATF tests, test removing output file
 1.7 24-Jun-2023  rillig lint: add query for comparing 'char' with plain integers
 1.6 24-Jun-2023  rillig lint: add query for redundant 'extern' in function declaration
 1.5 22-Jun-2023  rillig lint: add query for comma operator
 1.4 03-Jun-2023  rillig lint: add query for static variables in functions

This query allows finding hidden global variables, as an easier-to-read
alternative to 'objdump -t'.
 1.3 13-May-2023  rillig lint: add query for chained assignments
 1.2 23-Apr-2023  rillig lint: be strict when parsing command line for excluded message IDs

Previously, lint accepted -X '1, 2, 3', while the manual page lists the
IDs without spaces.

On 32-bit platforms, lint accepted -X -4294967295, and on 64-bit
platforms, it accepted the corresponding larger numbers.

The code for parsing message IDs and query IDs conceptually does the
same, but the implementations differed for no reason.
 1.1 23-Apr-2023  rillig tests/lint: test command line parsing for message and query IDs

The parsing methods differ but shouldn't.
 1.22.2.1 02-Aug-2025  perseant Sync with HEAD
 1.8 28-Aug-2021  rillig tests/lint: demonstrate hashcode sorting of the lint2 output

The hashcodes modulo 1009 are:

48 func7000
637 func0000
646 no_prototype
697 func1000
757 func2000
817 func3000
877 func4000
937 func5000
997 func6000
 1.7 24-Aug-2021  rillig lint: allow libraries to use 128-bit integer types
 1.6 08-Aug-2021  rillig tests/lint: include but don't run read_lp64 on 32-bit platforms

The lint1 tests are all in the machine-independent file list, which
makes it easier to manage them. At run time, some of them are skipped
based on platform characteristics. Do the same for the lint2 tests.

Having the lint2 test named read_lp64 as the only machine-dependent test
would complicate things.

The build for i386 had failed because the files for read_lp64 were
listed in distrib/sets/lists/tests/mi but were not actually installed.
 1.5 08-Aug-2021  rillig tests/lint: mips64 is not a 64-bit platform

See usr.bin/xlint/arch/mips64/targparam.h.
 1.4 08-Aug-2021  rillig tests/lint: make list of tests simpler

Since the file /usr/tests/usr.bin/xlint/lint2/tests has only been in the
file set for a few minutes, it is not marked as obsolete but simply
removed.
 1.3 07-Aug-2021  rillig tests/lint: test reading of 128-bit integer types and printf
 1.2 07-Aug-2021  rillig tests/lint: add test for reading the lint1 output
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.5 04-Sep-2021  rillig tests/lint: test old-style functions in a lint library

To really qualify as old-style, a function must not declare a return
type in its definition.
 1.4 04-Sep-2021  rillig tests/lint: test writing of a lint library

The code for that is almost the same as in lint1, but only almost.
 1.3 28-Aug-2021  rillig lint: write the entries for the libraries in alphabetical order

This makes them easier to read by humans.

The checks are still performed in hashcode order since there are no
tests that would cover this change.
 1.2 24-Aug-2021  rillig tests/lint: normalize whitespace in lint2 tests

Found a typo in read.ln, f124, which had just 'F' instead of the
intended 'F0'. Other than that, only whitespace changes.
 1.1 24-Aug-2021  rillig lint: allow libraries to use 128-bit integer types
 1.7 05-Nov-2024  rillig lint: fix cross references in comments
 1.6 01-Oct-2022  rillig branches: 1.6.4;
lint: miscellaneous cleanup

No functional change.
 1.5 15-Jan-2022  rillig tests/lint: fix comments
 1.4 04-Sep-2021  rillig tests/lint: test old-style functions in a lint library

To really qualify as old-style, a function must not declare a return
type in its definition.
 1.3 04-Sep-2021  rillig tests/lint: test writing of a lint library

The code for that is almost the same as in lint1, but only almost.
 1.2 24-Aug-2021  rillig tests/lint: normalize whitespace in lint2 tests

Found a typo in read.ln, f124, which had just 'F' instead of the
intended 'F0'. Other than that, only whitespace changes.
 1.1 24-Aug-2021  rillig lint: allow libraries to use 128-bit integer types
 1.6.4.1 02-Aug-2025  perseant Sync with HEAD
 1.3 28-Aug-2021  rillig lint: write the entries for the libraries in alphabetical order

This makes them easier to read by humans.

The checks are still performed in hashcode order since there are no
tests that would cover this change.
 1.2 24-Aug-2021  rillig tests/lint: normalize whitespace in lint2 tests

Found a typo in read.ln, f124, which had just 'F' instead of the
intended 'F0'. Other than that, only whitespace changes.
 1.1 24-Aug-2021  rillig lint: allow libraries to use 128-bit integer types
 1.2 24-Aug-2021  rillig tests/lint: normalize whitespace in lint2 tests

Found a typo in read.ln, f124, which had just 'F' instead of the
intended 'F0'. Other than that, only whitespace changes.
 1.1 24-Aug-2021  rillig lint: allow libraries to use 128-bit integer types
 1.2 30-Nov-2024  rillig lint: reword lint2 warnings, reduce punctuation

The previous diagnostics used unusual punctuation, for example by placing
spaces inside parentheses, as well as using space-space-tab and
double-colon as separators. Convert these diagnostics into readily
readable prose, and mark them clearly as coming from lint2, so that they
can be related to the tests in /usr/tests/usr.bin/xlint/lint2/msg_???.ln.

This change means that usr.bin/error no longer recognizes these messages
as coming from lint2, but that can be fixed later if necessary.
 1.1 05-Aug-2021  rillig branches: 1.1.4;
tests/lint: add test skeletons for messages from lint2
 1.1.4.1 02-Aug-2025  perseant Sync with HEAD
 1.6 20-Feb-2025  rillig tests/lint: sync messages in test comments with their counterparts
 1.5 02-Aug-2023  rillig branches: 1.5.2;
lint: distinguish between arguments and parameters
 1.4 30-May-2022  rillig lint: clean up comments

No binary change.
 1.3 12-Sep-2021  rillig tests/lint: make documentation for lint2/msg_000 less ambiguous
 1.2 24-Aug-2021  rillig tests/lint: normalize whitespace in lint2 tests

Found a typo in read.ln, f124, which had just 'F' instead of the
intended 'F0'. Other than that, only whitespace changes.
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.5.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 30-Nov-2024  rillig lint: reword lint2 warnings, reduce punctuation

The previous diagnostics used unusual punctuation, for example by placing
spaces inside parentheses, as well as using space-space-tab and
double-colon as separators. Convert these diagnostics into readily
readable prose, and mark them clearly as coming from lint2, so that they
can be related to the tests in /usr/tests/usr.bin/xlint/lint2/msg_???.ln.

This change means that usr.bin/error no longer recognizes these messages
as coming from lint2, but that can be fixed later if necessary.
 1.3 07-Aug-2021  rillig branches: 1.3.4;
tests/lint: add more tests for lint2
 1.2 06-Aug-2021  rillig tests/lint: add tests for declared but unused variables
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.3.4.1 02-Aug-2025  perseant Sync with HEAD
 1.7 20-Feb-2025  rillig tests/lint: sync messages in test comments with their counterparts
 1.6 14-Jan-2023  rillig branches: 1.6.2;
lint: rename lint2 functions to be more expressive
 1.5 01-Oct-2022  rillig lint: miscellaneous cleanup

No functional change.
 1.4 24-Aug-2021  rillig tests/lint: normalize whitespace in lint2 tests

Found a typo in read.ln, f124, which had just 'F' instead of the
intended 'F0'. Other than that, only whitespace changes.
 1.3 07-Aug-2021  rillig tests/lint: add more tests for lint2
 1.2 06-Aug-2021  rillig tests/lint: add tests for declared but unused variables
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.6.2.1 02-Aug-2025  perseant Sync with HEAD
 1.3 30-Nov-2024  rillig lint: reword lint2 warnings, reduce punctuation

The previous diagnostics used unusual punctuation, for example by placing
spaces inside parentheses, as well as using space-space-tab and
double-colon as separators. Convert these diagnostics into readily
readable prose, and mark them clearly as coming from lint2, so that they
can be related to the tests in /usr/tests/usr.bin/xlint/lint2/msg_???.ln.

This change means that usr.bin/error no longer recognizes these messages
as coming from lint2, but that can be fixed later if necessary.
 1.2 06-Aug-2021  rillig branches: 1.2.4;
tests/lint: add tests for declared but unused variables
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.2.4.1 02-Aug-2025  perseant Sync with HEAD
 1.4 20-Feb-2025  rillig tests/lint: sync messages in test comments with their counterparts
 1.3 24-Aug-2021  rillig branches: 1.3.4;
tests/lint: normalize whitespace in lint2 tests

Found a typo in read.ln, f124, which had just 'F' instead of the
intended 'F0'. Other than that, only whitespace changes.
 1.2 06-Aug-2021  rillig tests/lint: add tests for declared but unused variables
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.3.4.1 02-Aug-2025  perseant Sync with HEAD
 1.3 30-Nov-2024  rillig lint: reword lint2 warnings, reduce punctuation

The previous diagnostics used unusual punctuation, for example by placing
spaces inside parentheses, as well as using space-space-tab and
double-colon as separators. Convert these diagnostics into readily
readable prose, and mark them clearly as coming from lint2, so that they
can be related to the tests in /usr/tests/usr.bin/xlint/lint2/msg_???.ln.

This change means that usr.bin/error no longer recognizes these messages
as coming from lint2, but that can be fixed later if necessary.
 1.2 07-Aug-2021  rillig branches: 1.2.4;
tests/lint: add more tests for lint2
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.2.4.1 02-Aug-2025  perseant Sync with HEAD
 1.4 20-Feb-2025  rillig tests/lint: sync messages in test comments with their counterparts
 1.3 24-Aug-2021  rillig branches: 1.3.4;
tests/lint: normalize whitespace in lint2 tests

Found a typo in read.ln, f124, which had just 'F' instead of the
intended 'F0'. Other than that, only whitespace changes.
 1.2 07-Aug-2021  rillig tests/lint: add more tests for lint2
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.3.4.1 02-Aug-2025  perseant Sync with HEAD
 1.3 30-Nov-2024  rillig lint: reword lint2 warnings, reduce punctuation

The previous diagnostics used unusual punctuation, for example by placing
spaces inside parentheses, as well as using space-space-tab and
double-colon as separators. Convert these diagnostics into readily
readable prose, and mark them clearly as coming from lint2, so that they
can be related to the tests in /usr/tests/usr.bin/xlint/lint2/msg_???.ln.

This change means that usr.bin/error no longer recognizes these messages
as coming from lint2, but that can be fixed later if necessary.
 1.2 07-Aug-2021  rillig branches: 1.2.4;
tests/lint: add more tests for lint2
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.2.4.1 02-Aug-2025  perseant Sync with HEAD
 1.4 20-Feb-2025  rillig tests/lint: sync messages in test comments with their counterparts
 1.3 24-Aug-2021  rillig branches: 1.3.4;
tests/lint: normalize whitespace in lint2 tests

Found a typo in read.ln, f124, which had just 'F' instead of the
intended 'F0'. Other than that, only whitespace changes.
 1.2 07-Aug-2021  rillig tests/lint: add more tests for lint2
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.3.4.1 02-Aug-2025  perseant Sync with HEAD
 1.5 24-May-2025  rillig lint: fix wording in a warning about a type conflict

An object does not have a return type, only functions do.
 1.4 24-May-2025  rillig tests/lint: demonstrate wrong 'object returns' message
 1.3 30-Nov-2024  rillig lint: reword lint2 warnings, reduce punctuation

The previous diagnostics used unusual punctuation, for example by placing
spaces inside parentheses, as well as using space-space-tab and
double-colon as separators. Convert these diagnostics into readily
readable prose, and mark them clearly as coming from lint2, so that they
can be related to the tests in /usr/tests/usr.bin/xlint/lint2/msg_???.ln.

This change means that usr.bin/error no longer recognizes these messages
as coming from lint2, but that can be fixed later if necessary.
 1.2 07-Aug-2021  rillig branches: 1.2.4;
tests/lint: add more tests for lint2
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.2.4.1 02-Aug-2025  perseant Sync with HEAD
 1.5 24-May-2025  rillig tests/lint: demonstrate wrong 'object returns' message
 1.4 20-Feb-2025  rillig tests/lint: sync messages in test comments with their counterparts
 1.3 24-Aug-2021  rillig branches: 1.3.4;
tests/lint: normalize whitespace in lint2 tests

Found a typo in read.ln, f124, which had just 'F' instead of the
intended 'F0'. Other than that, only whitespace changes.
 1.2 07-Aug-2021  rillig tests/lint: add more tests for lint2
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.3.4.1 02-Aug-2025  perseant Sync with HEAD
 1.3 30-Nov-2024  rillig lint: reword lint2 warnings, reduce punctuation

The previous diagnostics used unusual punctuation, for example by placing
spaces inside parentheses, as well as using space-space-tab and
double-colon as separators. Convert these diagnostics into readily
readable prose, and mark them clearly as coming from lint2, so that they
can be related to the tests in /usr/tests/usr.bin/xlint/lint2/msg_???.ln.

This change means that usr.bin/error no longer recognizes these messages
as coming from lint2, but that can be fixed later if necessary.
 1.2 07-Aug-2021  rillig branches: 1.2.4;
tests/lint: add more tests for lint2
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.2.4.1 02-Aug-2025  perseant Sync with HEAD
 1.4 20-Feb-2025  rillig tests/lint: sync messages in test comments with their counterparts
 1.3 24-Aug-2021  rillig branches: 1.3.4;
tests/lint: normalize whitespace in lint2 tests

Found a typo in read.ln, f124, which had just 'F' instead of the
intended 'F0'. Other than that, only whitespace changes.
 1.2 07-Aug-2021  rillig tests/lint: add more tests for lint2
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.3.4.1 02-Aug-2025  perseant Sync with HEAD
 1.3 30-Nov-2024  rillig lint: reword lint2 warnings, reduce punctuation

The previous diagnostics used unusual punctuation, for example by placing
spaces inside parentheses, as well as using space-space-tab and
double-colon as separators. Convert these diagnostics into readily
readable prose, and mark them clearly as coming from lint2, so that they
can be related to the tests in /usr/tests/usr.bin/xlint/lint2/msg_???.ln.

This change means that usr.bin/error no longer recognizes these messages
as coming from lint2, but that can be fixed later if necessary.
 1.2 30-Nov-2024  rillig tests/lint: test message 7 of lint2
 1.1 05-Aug-2021  rillig branches: 1.1.4;
tests/lint: add test skeletons for messages from lint2
 1.1.4.1 02-Aug-2025  perseant Sync with HEAD
 1.3 20-Feb-2025  rillig tests/lint: sync messages in test comments with their counterparts
 1.2 30-Nov-2024  rillig tests/lint: test message 7 of lint2
 1.1 05-Aug-2021  rillig branches: 1.1.4;
tests/lint: add test skeletons for messages from lint2
 1.1.4.1 02-Aug-2025  perseant Sync with HEAD
 1.3 30-Nov-2024  rillig lint: reword lint2 warnings, reduce punctuation

The previous diagnostics used unusual punctuation, for example by placing
spaces inside parentheses, as well as using space-space-tab and
double-colon as separators. Convert these diagnostics into readily
readable prose, and mark them clearly as coming from lint2, so that they
can be related to the tests in /usr/tests/usr.bin/xlint/lint2/msg_???.ln.

This change means that usr.bin/error no longer recognizes these messages
as coming from lint2, but that can be fixed later if necessary.
 1.2 14-Aug-2021  rillig branches: 1.2.4;
tests/lint: add tests for messages 8, 9 and 10
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.2.4.1 02-Aug-2025  perseant Sync with HEAD
 1.4 20-Feb-2025  rillig tests/lint: sync messages in test comments with their counterparts
 1.3 24-Aug-2021  rillig branches: 1.3.4;
tests/lint: normalize whitespace in lint2 tests

Found a typo in read.ln, f124, which had just 'F' instead of the
intended 'F0'. Other than that, only whitespace changes.
 1.2 14-Aug-2021  rillig tests/lint: add tests for messages 8, 9 and 10
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.3.4.1 02-Aug-2025  perseant Sync with HEAD
 1.3 30-Nov-2024  rillig lint: reword lint2 warnings, reduce punctuation

The previous diagnostics used unusual punctuation, for example by placing
spaces inside parentheses, as well as using space-space-tab and
double-colon as separators. Convert these diagnostics into readily
readable prose, and mark them clearly as coming from lint2, so that they
can be related to the tests in /usr/tests/usr.bin/xlint/lint2/msg_???.ln.

This change means that usr.bin/error no longer recognizes these messages
as coming from lint2, but that can be fixed later if necessary.
 1.2 14-Aug-2021  rillig branches: 1.2.4;
tests/lint: add tests for messages 8, 9 and 10
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.2.4.1 02-Aug-2025  perseant Sync with HEAD
 1.4 20-Feb-2025  rillig tests/lint: sync messages in test comments with their counterparts
 1.3 24-Aug-2021  rillig branches: 1.3.4;
tests/lint: normalize whitespace in lint2 tests

Found a typo in read.ln, f124, which had just 'F' instead of the
intended 'F0'. Other than that, only whitespace changes.
 1.2 14-Aug-2021  rillig tests/lint: add tests for messages 8, 9 and 10
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.3.4.1 02-Aug-2025  perseant Sync with HEAD
 1.3 30-Nov-2024  rillig lint: reword lint2 warnings, reduce punctuation

The previous diagnostics used unusual punctuation, for example by placing
spaces inside parentheses, as well as using space-space-tab and
double-colon as separators. Convert these diagnostics into readily
readable prose, and mark them clearly as coming from lint2, so that they
can be related to the tests in /usr/tests/usr.bin/xlint/lint2/msg_???.ln.

This change means that usr.bin/error no longer recognizes these messages
as coming from lint2, but that can be fixed later if necessary.
 1.2 14-Aug-2021  rillig branches: 1.2.4;
tests/lint: add tests for messages 8, 9 and 10
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.2.4.1 02-Aug-2025  perseant Sync with HEAD
 1.4 20-Feb-2025  rillig tests/lint: sync messages in test comments with their counterparts
 1.3 24-Aug-2021  rillig branches: 1.3.4;
tests/lint: normalize whitespace in lint2 tests

Found a typo in read.ln, f124, which had just 'F' instead of the
intended 'F0'. Other than that, only whitespace changes.
 1.2 14-Aug-2021  rillig tests/lint: add tests for messages 8, 9 and 10
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.3.4.1 02-Aug-2025  perseant Sync with HEAD
 1.5 30-Nov-2024  rillig lint: reword lint2 warnings, reduce punctuation

The previous diagnostics used unusual punctuation, for example by placing
spaces inside parentheses, as well as using space-space-tab and
double-colon as separators. Convert these diagnostics into readily
readable prose, and mark them clearly as coming from lint2, so that they
can be related to the tests in /usr/tests/usr.bin/xlint/lint2/msg_???.ln.

This change means that usr.bin/error no longer recognizes these messages
as coming from lint2, but that can be fixed later if necessary.
 1.4 30-Nov-2024  rillig lint: fix type name of prototype function in lint2 messages

Since tyname.c 1.42 from 2021-06-28, when the type names for '(void)'
prototypes was fixed for lint1 but not for lint2.
 1.3 30-Nov-2024  rillig tests/lint: demonstrate wrong type name for prototype function
 1.2 07-Aug-2021  rillig branches: 1.2.4;
tests/lint: add more tests for lint2
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.2.4.1 02-Aug-2025  perseant Sync with HEAD
 1.6 20-Feb-2025  rillig tests/lint: sync messages in test comments with their counterparts
 1.5 30-Nov-2024  rillig lint: fix type name of prototype function in lint2 messages

Since tyname.c 1.42 from 2021-06-28, when the type names for '(void)'
prototypes was fixed for lint1 but not for lint2.
 1.4 30-Nov-2024  rillig tests/lint: demonstrate wrong type name for prototype function
 1.3 24-Aug-2021  rillig branches: 1.3.4;
tests/lint: normalize whitespace in lint2 tests

Found a typo in read.ln, f124, which had just 'F' instead of the
intended 'F0'. Other than that, only whitespace changes.
 1.2 07-Aug-2021  rillig tests/lint: add more tests for lint2
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.3.4.1 02-Aug-2025  perseant Sync with HEAD
 1.3 30-Nov-2024  rillig lint: reword lint2 warnings, reduce punctuation

The previous diagnostics used unusual punctuation, for example by placing
spaces inside parentheses, as well as using space-space-tab and
double-colon as separators. Convert these diagnostics into readily
readable prose, and mark them clearly as coming from lint2, so that they
can be related to the tests in /usr/tests/usr.bin/xlint/lint2/msg_???.ln.

This change means that usr.bin/error no longer recognizes these messages
as coming from lint2, but that can be fixed later if necessary.
 1.2 07-Aug-2021  rillig branches: 1.2.4;
tests/lint: add more tests for lint2
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.2.4.1 02-Aug-2025  perseant Sync with HEAD
 1.4 20-Feb-2025  rillig tests/lint: sync messages in test comments with their counterparts
 1.3 24-Aug-2021  rillig branches: 1.3.4;
tests/lint: normalize whitespace in lint2 tests

Found a typo in read.ln, f124, which had just 'F' instead of the
intended 'F0'. Other than that, only whitespace changes.
 1.2 07-Aug-2021  rillig tests/lint: add more tests for lint2
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.3.4.1 02-Aug-2025  perseant Sync with HEAD
 1.3 30-Nov-2024  rillig lint: reword lint2 warnings, reduce punctuation

The previous diagnostics used unusual punctuation, for example by placing
spaces inside parentheses, as well as using space-space-tab and
double-colon as separators. Convert these diagnostics into readily
readable prose, and mark them clearly as coming from lint2, so that they
can be related to the tests in /usr/tests/usr.bin/xlint/lint2/msg_???.ln.

This change means that usr.bin/error no longer recognizes these messages
as coming from lint2, but that can be fixed later if necessary.
 1.2 05-Aug-2023  rillig branches: 1.2.2;
tests/lint: test C99 printf conversion specifiers in lint2
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.2.2.1 02-Aug-2025  perseant Sync with HEAD
 1.3 20-Feb-2025  rillig tests/lint: sync messages in test comments with their counterparts
 1.2 05-Aug-2023  rillig branches: 1.2.2;
tests/lint: test C99 printf conversion specifiers in lint2
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.2.2.1 02-Aug-2025  perseant Sync with HEAD
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.2 20-Feb-2025  rillig tests/lint: sync messages in test comments with their counterparts
 1.1 05-Aug-2021  rillig branches: 1.1.4;
tests/lint: add test skeletons for messages from lint2
 1.1.4.1 02-Aug-2025  perseant Sync with HEAD
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.2 20-Feb-2025  rillig tests/lint: sync messages in test comments with their counterparts
 1.1 05-Aug-2021  rillig branches: 1.1.4;
tests/lint: add test skeletons for messages from lint2
 1.1.4.1 02-Aug-2025  perseant Sync with HEAD
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.3 20-Feb-2025  rillig tests/lint: sync messages in test comments with their counterparts
 1.2 01-Apr-2022  rillig branches: 1.2.4;
tests/lint2: add missing character in comment
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.2.4.1 02-Aug-2025  perseant Sync with HEAD
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.2 20-Feb-2025  rillig tests/lint: sync messages in test comments with their counterparts
 1.1 05-Aug-2021  rillig branches: 1.1.4;
tests/lint: add test skeletons for messages from lint2
 1.1.4.1 02-Aug-2025  perseant Sync with HEAD
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.2 20-Feb-2025  rillig tests/lint: sync messages in test comments with their counterparts
 1.1 05-Aug-2021  rillig branches: 1.1.4;
tests/lint: add test skeletons for messages from lint2
 1.1.4.1 02-Aug-2025  perseant Sync with HEAD
 1.3 30-Nov-2024  rillig lint: reword lint2 warnings, reduce punctuation

The previous diagnostics used unusual punctuation, for example by placing
spaces inside parentheses, as well as using space-space-tab and
double-colon as separators. Convert these diagnostics into readily
readable prose, and mark them clearly as coming from lint2, so that they
can be related to the tests in /usr/tests/usr.bin/xlint/lint2/msg_???.ln.

This change means that usr.bin/error no longer recognizes these messages
as coming from lint2, but that can be fixed later if necessary.
 1.2 28-Aug-2021  rillig branches: 1.2.4;
lint: sort the lint2 diagnostics by symbol name
 1.1 28-Aug-2021  rillig tests/lint: demonstrate hashcode sorting of the lint2 output

The hashcodes modulo 1009 are:

48 func7000
637 func0000
646 no_prototype
697 func1000
757 func2000
817 func3000
877 func4000
937 func5000
997 func6000
 1.2.4.1 02-Aug-2025  perseant Sync with HEAD
 1.2 15-Jan-2022  rillig tests/lint: fix comments
 1.1 28-Aug-2021  rillig tests/lint: demonstrate hashcode sorting of the lint2 output

The hashcodes modulo 1009 are:

48 func7000
637 func0000
646 no_prototype
697 func1000
757 func2000
817 func3000
877 func4000
937 func5000
997 func6000
 1.5 30-Nov-2024  rillig lint: reword lint2 warnings, reduce punctuation

The previous diagnostics used unusual punctuation, for example by placing
spaces inside parentheses, as well as using space-space-tab and
double-colon as separators. Convert these diagnostics into readily
readable prose, and mark them clearly as coming from lint2, so that they
can be related to the tests in /usr/tests/usr.bin/xlint/lint2/msg_???.ln.

This change means that usr.bin/error no longer recognizes these messages
as coming from lint2, but that can be fixed later if necessary.
 1.4 30-Aug-2021  rillig branches: 1.4.4;
tests/lint: test writing and reading .ln files

The test case for reading varargs functions is no longer necessary, the
code is covered by the newly added tests as well.

Test inline function and return value usage.
 1.3 30-Aug-2021  rillig tests/lint: test reading of varargs, printflike, scanflike
 1.2 30-Aug-2021  rillig lint: revert "remove redundant call to strchr" from yesterday

This "refactoring" broke the parsing code for varargs, printflike and
scanflike functions, and there were no tests for these. Revert for now,
maybe try again later, after adding the corresponding tests.
 1.1 07-Aug-2021  rillig tests/lint: add test for reading the lint1 output
 1.4.4.1 02-Aug-2025  perseant Sync with HEAD
 1.9 05-Nov-2024  rillig lint: fix cross references in comments
 1.8 02-Aug-2023  rillig branches: 1.8.2;
lint: distinguish between arguments and parameters
 1.7 03-Jul-2023  rillig lint: rename uppercase QUAD to LLONG

No binary change.
 1.6 22-May-2023  rillig lint: rename constant NOTSPEC to NO_TSPEC

It was too easy to misread the old name as NOT_SPEC instead of the
intended NO_TSPEC.
 1.5 30-Aug-2021  rillig tests/lint: test writing and reading .ln files

The test case for reading varargs functions is no longer necessary, the
code is covered by the newly added tests as well.

Test inline function and return value usage.
 1.4 30-Aug-2021  rillig tests/lint: test reading of varargs, printflike, scanflike
 1.3 30-Aug-2021  rillig lint: revert "remove redundant call to strchr" from yesterday

This "refactoring" broke the parsing code for varargs, printflike and
scanflike functions, and there were no tests for these. Revert for now,
maybe try again later, after adding the corresponding tests.
 1.2 24-Aug-2021  rillig tests/lint: normalize whitespace in lint2 tests

Found a typo in read.ln, f124, which had just 'F' instead of the
intended 'F0'. Other than that, only whitespace changes.
 1.1 07-Aug-2021  rillig tests/lint: add test for reading the lint1 output
 1.8.2.1 02-Aug-2025  perseant Sync with HEAD
 1.1 07-Aug-2021  rillig tests/lint: test reading of 128-bit integer types and printf
 1.2 24-Aug-2021  rillig tests/lint: normalize whitespace in lint2 tests

Found a typo in read.ln, f124, which had just 'F' instead of the
intended 'F0'. Other than that, only whitespace changes.
 1.1 07-Aug-2021  rillig tests/lint: test reading of 128-bit integer types and printf
 1.1 07-Aug-2021  rillig tests/lint: test reading of 128-bit integer types and printf
 1.3 24-Aug-2021  rillig tests/lint: normalize whitespace in lint2 tests

Found a typo in read.ln, f124, which had just 'F' instead of the
intended 'F0'. Other than that, only whitespace changes.
 1.2 08-Aug-2021  rillig tests/lint: test passing of printf-like strings between lint1 and lint2
 1.1 07-Aug-2021  rillig tests/lint: test reading of 128-bit integer types and printf
 1.13 16-Dec-2021  rillig tests/lint: fix copy-and-paste typo in comment
 1.12 16-Dec-2021  rillig lint: improve error message for missing newline in .ln file
 1.11 16-Dec-2021  rillig tests/lint: demonstrate bad error message on missing newline
 1.10 28-Nov-2021  rillig lint2: in case of parse errors, output the offending line

This provides more of a clue than a simple '(not alnum or _: )',
especially in the output of build.sh.

While here, change the format of the error message to the standard
'%s:%d'. Since these are internal errors, they are not supposed to occur
often, so no need to change error(1).
 1.9 28-Nov-2021  rillig tests/lint2: fix regular expressions containing backslash

In regular expressions, a backslash must be doubled. In this case, ATF
didn't complain because the single backslashes were used in the pattern
'\($2\)', where they produced '\(...\\)'. Omitting the backslash for the
closing parenthesis was apparently OK; other regex implementations
complain about this.
 1.8 05-Sep-2021  rillig lint: hide irrelevant type information from lint2

No functional change.
 1.7 04-Sep-2021  rillig tests/lint: test error handling when reading .ln files
 1.6 24-Aug-2021  rillig lint: allow libraries to use 128-bit integer types
 1.5 08-Aug-2021  rillig tests/lint: include but don't run read_lp64 on 32-bit platforms

The lint1 tests are all in the machine-independent file list, which
makes it easier to manage them. At run time, some of them are skipped
based on platform characteristics. Do the same for the lint2 tests.

Having the lint2 test named read_lp64 as the only machine-dependent test
would complicate things.

The build for i386 had failed because the files for read_lp64 were
listed in distrib/sets/lists/tests/mi but were not actually installed.
 1.4 08-Aug-2021  rillig tests/lint: make list of tests simpler

Since the file /usr/tests/usr.bin/xlint/lint2/tests has only been in the
file set for a few minutes, it is not marked as obsolete but simply
removed.
 1.3 07-Aug-2021  rillig tests/lint: test reading of 128-bit integer types and printf
 1.2 07-Aug-2021  rillig tests/lint: add test for reading the lint1 output
 1.1 05-Aug-2021  rillig tests/lint: add test skeletons for messages from lint2
 1.1 15-Jan-2023  rillig tests/lint: add basic tests for lint (not lint1 or lint2)
 1.5 30-Nov-2024  rillig lint: reword lint2 warnings, reduce punctuation

The previous diagnostics used unusual punctuation, for example by placing
spaces inside parentheses, as well as using space-space-tab and
double-colon as separators. Convert these diagnostics into readily
readable prose, and mark them clearly as coming from lint2, so that they
can be related to the tests in /usr/tests/usr.bin/xlint/lint2/msg_???.ln.

This change means that usr.bin/error no longer recognizes these messages
as coming from lint2, but that can be fixed later if necessary.
 1.4 07-Sep-2023  rillig branches: 1.4.2;
tests/lint: allow lint libraries to be installed
 1.3 07-Jul-2023  rillig 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.2 28-Jun-2023  rillig tests/lint: use standard form of ATF tests, test removing output file
 1.1 15-Jan-2023  rillig tests/lint: add basic tests for lint (not lint1 or lint2)
 1.4.2.1 02-Aug-2025  perseant Sync with HEAD

RSS XML Feed