Module Name: src
Committed By: christos
Date: Wed Apr 14 21:20:21 UTC 2021
Modified Files:
src/usr.bin/xlint/lint1: cgram.y
Log Message:
there is also an optional type qualifier list in the array size
To generate a diff of this commit:
cvs rdiff -u -r1.216 -r1.217 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.216 src/usr.bin/xlint/lint1/cgram.y:1.217
--- src/usr.bin/xlint/lint1/cgram.y:1.216 Wed Apr 14 14:35:40 2021
+++ src/usr.bin/xlint/lint1/cgram.y Wed Apr 14 17:20:21 2021
@@ -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 @@ param_decl:
}
;
+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;