Module Name:    src
Committed By:   christos
Date:           Tue Jul 28 17:56:56 UTC 2015

Modified Files:
        src/usr.bin/xlint/lint1: cgram.y

Log Message:
handle c99 nested struct initialization { .data.foo[0] = 1 }


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 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.70 src/usr.bin/xlint/lint1/cgram.y:1.71
--- src/usr.bin/xlint/lint1/cgram.y:1.70	Wed Jul  1 11:34:30 2015
+++ src/usr.bin/xlint/lint1/cgram.y	Tue Jul 28 13:56:56 2015
@@ -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 @@ range:
 	  }
 	;
 
-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);

Reply via email to