Module Name: src Committed By: rillig Date: Sat Jul 10 20:58:35 UTC 2021
Modified Files: src/usr.bin/xlint/lint1: cgram.y Log Message: lint: move type_attribute back into the main section Type attributes are a standard feature since C11 and thus do not belong in the GCC-specific section. Only the GCC __attribute__ belongs there. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.301 -r1.302 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.301 src/usr.bin/xlint/lint1/cgram.y:1.302 --- src/usr.bin/xlint/lint1/cgram.y:1.301 Sat Jul 10 20:44:23 2021 +++ src/usr.bin/xlint/lint1/cgram.y Sat Jul 10 20:58:35 2021 @@ -1,5 +1,5 @@ %{ -/* $NetBSD: cgram.y,v 1.301 2021/07/10 20:44:23 rillig Exp $ */ +/* $NetBSD: cgram.y,v 1.302 2021/07/10 20:58:35 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.301 2021/07/10 20:44:23 rillig Exp $"); +__RCSID("$NetBSD: cgram.y,v 1.302 2021/07/10 20:58:35 rillig Exp $"); #endif #include <limits.h> @@ -563,6 +563,30 @@ add_type_specifier: } ; +type_attribute_list_opt: + /* empty */ + | type_attribute_list + ; + +type_attribute_list: + type_attribute + | type_attribute_list type_attribute + ; + +type_attribute_opt: + /* empty */ + | type_attribute + ; + +type_attribute: /* See C11 6.7 declaration-specifiers */ + gcc_attribute + | T_ALIGNAS T_LPAREN align_as T_RPAREN + | T_PACKED { + addpacked(); + } + | T_NORETURN + ; + type_specifier: /* C99 6.7.2 */ notype_type_specifier | T_TYPENAME { @@ -1901,30 +1925,6 @@ comma_opt: /* GCC extensions */ -type_attribute_list_opt: - /* empty */ - | type_attribute_list - ; - -type_attribute_list: - type_attribute - | type_attribute_list type_attribute - ; - -type_attribute_opt: - /* empty */ - | type_attribute - ; - -type_attribute: - gcc_attribute - | T_ALIGNAS T_LPAREN align_as T_RPAREN - | T_PACKED { - addpacked(); - } - | T_NORETURN - ; - gcc_attribute_list_opt: /* empty */ | gcc_attribute_list