Received: by mail.netbsd.org (Postfix, from userid 605) id CC6D484EFF; Sun, 11 Jul 2021 16:57:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 03F8984EFE for ; Sun, 11 Jul 2021 16:57:22 +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 vUWXpfOmsTFh for ; Sun, 11 Jul 2021 16:57:21 +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 7785884EF5 for ; Sun, 11 Jul 2021 16:57:21 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 65551FA95; Sun, 11 Jul 2021 16:57:21 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Sun, 11 Jul 2021 16:57:21 +0000 From: "Roland Illig" Subject: CVS commit: src/usr.bin/xlint/lint1 To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20210711165721.65551FA95@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: Sun Jul 11 16:57:21 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: cgram.y Log Message: lint: resolve shift/reduce conflicts for unary expressions The grammar rule 'term' was ambiguous since both the prefix and postfix increment operators were listed with the same precedence. The expression '++x++' was parsed as '++ (x++)', as expected, since conflicts resolve towards shift. Resolve these conflicts by structuring the grammar as in C99, with the GCC extension of statement-expressions. The resolved conflicts are: 134: shift/reduce conflict (shift 161, reduce 347) on T_LBRACK 134: shift/reduce conflict (shift 162, reduce 347) on T_LPAREN 134: shift/reduce conflict (shift 163, reduce 347) on T_POINT 134: shift/reduce conflict (shift 164, reduce 347) on T_ARROW 134: shift/reduce conflict (shift 165, reduce 347) on T_INCDEC state 134 term : term . T_INCDEC (335) term : term . T_LBRACK expr T_RBRACK (341) term : term . T_LPAREN T_RPAREN (342) term : term . T_LPAREN argument_expression_list T_RPAREN (343) term : term . point_or_arrow T_NAME (344) term : T_EXTENSION term . (347) No functional change. To generate a diff of this commit: cvs rdiff -u -r1.306 -r1.307 src/usr.bin/xlint/lint1/cgram.y Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.