History log of /src/tests/usr.bin/xlint/lint1/init_braces.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base
# 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.


Revision tags: perseant-exfatfs-base-20240630 perseant-exfatfs-base
# 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.


Revision tags: netbsd-10-1-RELEASE netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 netbsd-10-0-RC1 netbsd-10-base
# 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