Module Name: src Committed By: rillig Date: Wed Dec 22 00:45:53 UTC 2021
Modified Files: src/tests/usr.bin/xlint/lint1: d_c99_init.c d_c99_init.exp d_init_array_using_string.c d_init_array_using_string.exp init.c init.exp msg_179.c msg_179.exp src/usr.bin/xlint/lint1: err.c init.c Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/tests/usr.bin/xlint/lint1/d_c99_init.c cvs rdiff -u -r1.27 -r1.28 src/tests/usr.bin/xlint/lint1/d_c99_init.exp cvs rdiff -u -r1.7 -r1.8 \ src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c \ src/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp cvs rdiff -u -r1.9 -r1.10 src/tests/usr.bin/xlint/lint1/init.c \ src/tests/usr.bin/xlint/lint1/init.exp cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_179.c \ src/tests/usr.bin/xlint/lint1/msg_179.exp cvs rdiff -u -r1.149 -r1.150 src/usr.bin/xlint/lint1/err.c cvs rdiff -u -r1.228 -r1.229 src/usr.bin/xlint/lint1/init.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.