Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint/lint1 lint: move type_attribute back into the ...



details:   https://anonhg.NetBSD.org/src/rev/8a69fd8c9da9
branches:  trunk
changeset: 1022259:8a69fd8c9da9
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jul 10 20:58:35 2021 +0000

description:
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.

diffstat:

 usr.bin/xlint/lint1/cgram.y |  52 ++++++++++++++++++++++----------------------
 1 files changed, 26 insertions(+), 26 deletions(-)

diffs (81 lines):

diff -r b45b2b00bce4 -r 8a69fd8c9da9 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Sat Jul 10 20:44:23 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Sat Jul 10 20:58:35 2021 +0000
@@ -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 @@
          }
        ;
 
+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 @@
 
 /* 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



Home | Main Index | Thread Index | Old Index