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 there is also an optional type qualifier...



details:   https://anonhg.NetBSD.org/src/rev/cc68050a88bf
branches:  trunk
changeset: 1020524:cc68050a88bf
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Apr 14 21:20:21 2021 +0000

description:
there is also an optional type qualifier list in the array size

diffstat:

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

diffs (41 lines):

diff -r 254ac57188c0 -r cc68050a88bf usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Wed Apr 14 21:20:02 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Wed Apr 14 21:20:21 2021 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.216 2021/04/14 18:35:40 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.217 2021/04/14 21:20:21 christos 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.216 2021/04/14 18:35:40 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.217 2021/04/14 21:20:21 christos Exp $");
 #endif
 
 #include <limits.h>
@@ -1132,14 +1132,18 @@
          }
        ;
 
+opt_type_qualifier_list:
+       | type_qualifier_list;
+       ;
+
 array_size:
-         T_SCLASS constant_expr {
+         opt_type_qualifier_list T_SCLASS constant_expr {
                /* C11 6.7.6.3p7 */
-               if ($1 != STATIC)
+               if ($2 != STATIC)
                        yyerror("Bad attribute");
                /* static array size is a C11 extension */
                c11ism(343);
-               $$ = $2;
+               $$ = $3;
          }
        | constant_expr {
                $$ = $1;



Home | Main Index | Thread Index | Old Index