Module Name: src Committed By: rillig Date: Sun Jul 11 15:07:39 UTC 2021
Modified Files: src/tests/usr.bin/xlint/lint1: decl.c decl.exp gcc_attribute_var.c gcc_attribute_var.exp src/usr.bin/xlint/lint1: cgram.y Log Message: lint: fix bug when parsing unused variable (since 2021-07-10) Partially revert to cgram.y 1.248 from 2021-06-29. This fixes the parse error for variables whose declaration starts with __attribute__((unused)). In the many refactorings of the last days this bug has slipped in, and since there were several refactorings in that area, there may be have been further bugs that are not caught by the current test suite. Revert for now and maybe apply them later again when there are more tests. Things kept from the current version are: The names of most of the rules, as they correspond more closely to C99 and do not affect the behavior in any way. In type_direct_decl, the replacement of type_attribute_list with type_attribute since that nonterminal is already part of a repetition (saves 4 conflicts). In block_item, the order of the rules corresponds to C99. This has no influence on the generated parser, except for the rule numbers, which are informative. The merge of the duplicate code for struct_tag, enum_tag and enum_constant, as they all contained exactly the same code. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/decl.c \ src/tests/usr.bin/xlint/lint1/decl.exp cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/gcc_attribute_var.c \ src/tests/usr.bin/xlint/lint1/gcc_attribute_var.exp cvs rdiff -u -r1.305 -r1.306 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.