#
1.16 |
|
08-Jun-2024 |
rillig |
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.
|
Revision tags: 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.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.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.
|
Revision tags: netbsd-10-base
|
#
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.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.
|
Revision tags: netbsd-10-base
|
#
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.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.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.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.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.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
|