Received: by mail.netbsd.org (Postfix, from userid 605) id 0934884EC2; Wed, 22 Dec 2021 00:45:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 3F38084EBF for ; Wed, 22 Dec 2021 00:45:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id fxBdFgxo4oQC for ; Wed, 22 Dec 2021 00:45:53 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 84F7C84D1D for ; Wed, 22 Dec 2021 00:45:53 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 7E0FCFAEC; Wed, 22 Dec 2021 00:45:53 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Wed, 22 Dec 2021 00:45:53 +0000 From: "Roland Illig" Subject: CVS commit: src To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20211222004553.7E0FCFAEC@cvs.NetBSD.org> Sender: source-changes-owner@NetBSD.org List-Id: Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "Roland Illig" Mail-Followup-To: source-changes-d@NetBSD.org List-Unsubscribe: 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.