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 accept optional type attributes after st...



details:   https://anonhg.NetBSD.org/src/rev/c6fda7e20f49
branches:  trunk
changeset: 820093:c6fda7e20f49
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Dec 29 16:01:46 2016 +0000

description:
accept optional type attributes after struct/union members

diffstat:

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

diffs (79 lines):

diff -r 3fc803b539fd -r c6fda7e20f49 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Thu Dec 29 13:46:21 2016 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Thu Dec 29 16:01:46 2016 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.82 2016/12/27 21:52:35 christos Exp $ */
+/* $NetBSD: cgram.y,v 1.83 2016/12/29 16:01:46 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.82 2016/12/27 21:52:35 christos Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.83 2016/12/29 16:01:46 christos Exp $");
 #endif
 
 #include <stdlib.h>
@@ -117,7 +117,7 @@
 }
 %}
 
-%expect 88
+%expect 92
 
 %union {
        int     y_int;
@@ -504,6 +504,7 @@
        | T_AT_ALIGNED T_LPARN constant T_RPARN
        | T_AT_SENTINEL T_LPARN constant T_RPARN
        | T_AT_FORMAT_ARG T_LPARN constant T_RPARN
+       | T_AT_ALIGNED 
        | T_AT_MAY_ALIAS
        | T_AT_NORETURN
        | T_AT_COLD
@@ -694,6 +695,12 @@
          }
        ;
 
+opt_type_attribute:
+         /* empty */ {
+       }
+       | type_attribute
+       ;
+
 member_declaration_list:
          member_declaration {
                $$ = $1;
@@ -707,17 +714,17 @@
          noclass_declmods deftyp {
                /* too late, i know, but getsym() compensates it */
                symtyp = FMOS;
-         } notype_member_decls {
+         } notype_member_decls opt_type_attribute {
                symtyp = FVFT;
                $$ = $4;
          }
        | noclass_declspecs deftyp {
                symtyp = FMOS;
-         } type_member_decls {
+         } type_member_decls opt_type_attribute {
                symtyp = FVFT;
                $$ = $4;
          }
-       | noclass_declmods deftyp {
+       | noclass_declmods deftyp opt_type_attribute {
                symtyp = FVFT;
                /* struct or union member must be named */
                if (!Sflag)
@@ -726,7 +733,7 @@
                $$ = dcs->d_type->t_str->memb;
                anonymize($$);
          }
-       | noclass_declspecs deftyp {
+       | noclass_declspecs deftyp opt_type_attribute {
                symtyp = FVFT;
                /* struct or union member must be named */
                if (!Sflag)



Home | Main Index | Thread Index | Old Index