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: inline align_as in the grammar



details:   https://anonhg.NetBSD.org/src/rev/a6ed83316d0c
branches:  trunk
changeset: 984877:a6ed83316d0c
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Jul 27 05:52:53 2021 +0000

description:
lint: inline align_as in the grammar

This saves 500 bytes in the resulting binary.

No functional change.

diffstat:

 usr.bin/xlint/lint1/cgram.y |  13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)

diffs (41 lines):

diff -r aa53c12c0b9b -r a6ed83316d0c usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Tue Jul 27 05:42:36 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Tue Jul 27 05:52:53 2021 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.350 2021/07/27 05:42:36 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.351 2021/07/27 05:52:53 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.350 2021/07/27 05:42:36 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.351 2021/07/27 05:52:53 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -836,19 +836,14 @@
 
 type_attribute:                        /* See C11 6.7 declaration-specifiers */
          gcc_attribute
-         /* TODO: c11ism */
-       | T_ALIGNAS T_LPAREN align_as T_RPAREN
+       | T_ALIGNAS T_LPAREN type_specifier T_RPAREN    /* C11 6.7.5 */
+       | T_ALIGNAS T_LPAREN constant_expr T_RPAREN     /* C11 6.7.5 */
        | T_PACKED {
                addpacked();
          }
        | T_NORETURN
        ;
 
-align_as:                      /* See alignment-specifier in C11 6.7.5 */
-         type_specifier
-       | constant_expr
-       ;
-
 begin_type:
          /* empty */ {
                begin_type();



Home | Main Index | Thread Index | Old Index