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 handle c99 nested struct initialization ...
details: https://anonhg.NetBSD.org/src/rev/e8ef39c955da
branches: trunk
changeset: 339561:e8ef39c955da
user: christos <christos%NetBSD.org@localhost>
date: Tue Jul 28 17:56:56 2015 +0000
description:
handle c99 nested struct initialization { .data.foo[0] = 1 }
diffstat:
usr.bin/xlint/lint1/cgram.y | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
diffs (48 lines):
diff -r d67338f161ba -r e8ef39c955da usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y Tue Jul 28 17:55:13 2015 +0000
+++ b/usr.bin/xlint/lint1/cgram.y Tue Jul 28 17:56:56 2015 +0000
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: cgram.y,v 1.70 2015/07/01 15:34:30 christos Exp $ */
+/* $NetBSD: cgram.y,v 1.71 2015/07/28 17:56:56 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.70 2015/07/01 15:34:30 christos Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.71 2015/07/28 17:56:56 christos Exp $");
#endif
#include <stdlib.h>
@@ -1241,16 +1241,25 @@
}
;
-init_by_name:
- T_LBRACK range T_RBRACK T_ASSIGN {
+init_field:
+ T_LBRACK range T_RBRACK {
if (!Sflag)
warning(321);
}
- | point identifier T_ASSIGN {
+ | point identifier {
if (!Sflag)
warning(313);
memberpush($2);
}
+ ;
+
+init_field_list:
+ init_field
+ | init_field_list init_field
+ ;
+
+init_by_name:
+ init_field_list T_ASSIGN
| identifier T_COLON {
gnuism(315);
memberpush($1);
Home |
Main Index |
Thread Index |
Old Index