Module Name: src Committed By: rillig Date: Sun Jul 11 18:22:03 UTC 2021
Modified Files: src/usr.bin/xlint/lint1: cgram.y Log Message: lint: resolve shift/reduce conflict in notype_direct_decl When a notype_direct_decl was followed by a type_attribute_list, and the next token was another type_attribute, the parser could either continue the current type_attribute_list or start a new one. Either way has the same effect since type_attribute_list has no associated action. This reduces the conflicts by 4, one for each of T_ALIGNAS, T_ATTRIBUTE, T_NORETURN, T_PACKED. There are several other conflicts involving these 4 tokens, but they are harder to fix. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.310 -r1.311 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.
Modified files: Index: src/usr.bin/xlint/lint1/cgram.y diff -u src/usr.bin/xlint/lint1/cgram.y:1.310 src/usr.bin/xlint/lint1/cgram.y:1.311 --- src/usr.bin/xlint/lint1/cgram.y:1.310 Sun Jul 11 18:03:47 2021 +++ src/usr.bin/xlint/lint1/cgram.y Sun Jul 11 18:22:02 2021 @@ -1,5 +1,5 @@ %{ -/* $NetBSD: cgram.y,v 1.310 2021/07/11 18:03:47 rillig Exp $ */ +/* $NetBSD: cgram.y,v 1.311 2021/07/11 18:22:02 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -35,7 +35,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: cgram.y,v 1.310 2021/07/11 18:03:47 rillig Exp $"); +__RCSID("$NetBSD: cgram.y,v 1.311 2021/07/11 18:22:02 rillig Exp $"); #endif #include <limits.h> @@ -124,7 +124,7 @@ anonymize(sym_t *s) %} -%expect 172 +%expect 168 %union { val_t *y_val; @@ -979,7 +979,7 @@ notype_direct_decl: end_declaration_level(); block_level--; } - | notype_direct_decl type_attribute_list + | notype_direct_decl type_attribute ; type_direct_decl: