Module Name:    src
Committed By:   christos
Date:           Fri May  1 22:03:36 UTC 2009

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

Log Message:
add variable declarations in for loops for c99


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/usr.bin/xlint/lint1/Makefile \
    src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.40 -r1.41 src/usr.bin/xlint/lint1/err.c

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/Makefile
diff -u src/usr.bin/xlint/lint1/Makefile:1.42 src/usr.bin/xlint/lint1/Makefile:1.43
--- src/usr.bin/xlint/lint1/Makefile:1.42	Tue Apr 14 05:10:00 2009
+++ src/usr.bin/xlint/lint1/Makefile	Fri May  1 18:03:36 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.42 2009/04/14 09:10:00 lukem Exp $
+#	$NetBSD: Makefile,v 1.43 2009/05/01 22:03:36 christos Exp $
 
 .include <bsd.own.mk>
 
@@ -8,6 +8,7 @@
 MAN=		lint.7
 YHEADER=
 #CFLAGS+=-g
+#CPPFLAGS+=-DYYDEBUG=1
 
 CPPFLAGS+=	-I${.CURDIR} -I. -DPASS=\"${PROG}.h\"
 
Index: src/usr.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.42 src/usr.bin/xlint/lint1/cgram.y:1.43
--- src/usr.bin/xlint/lint1/cgram.y:1.42	Sun Nov 16 02:06:37 2008
+++ src/usr.bin/xlint/lint1/cgram.y	Fri May  1 18:03:36 2009
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.42 2008/11/16 07:06:37 dholland Exp $ */
+/* $NetBSD: cgram.y,v 1.43 2009/05/01 22:03:36 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.42 2008/11/16 07:06:37 dholland Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.43 2009/05/01 22:03:36 christos Exp $");
 #endif
 
 #include <stdlib.h>
@@ -107,7 +107,7 @@
 #endif
 %}
 
-%expect 1
+%expect 3
 
 %union {
 	int	y_int;
@@ -1462,7 +1462,13 @@
 	;
 
 for_exprs:
-	  T_FOR T_LPARN opt_expr T_SEMI opt_expr T_SEMI opt_expr T_RPARN {
+	    T_FOR T_LPARN declspecs deftyp notype_init_decls T_SEMI opt_expr
+	    T_SEMI opt_expr T_RPARN {
+		c99ism(325);
+		for1(NULL, $7, $9);
+		CLRWFLGS(__FILE__, __LINE__);
+	    }
+	  | T_FOR T_LPARN opt_expr T_SEMI opt_expr T_SEMI opt_expr T_RPARN {
 		for1($3, $5, $7);
 		CLRWFLGS(__FILE__, __LINE__);
 	  }

Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.40 src/usr.bin/xlint/lint1/err.c:1.41
--- src/usr.bin/xlint/lint1/err.c:1.40	Tue Apr 14 21:20:57 2009
+++ src/usr.bin/xlint/lint1/err.c	Fri May  1 18:03:36 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.c,v 1.40 2009/04/15 01:20:57 christos Exp $	*/
+/*	$NetBSD: err.c,v 1.41 2009/05/01 22:03:36 christos Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: err.c,v 1.40 2009/04/15 01:20:57 christos Exp $");
+__RCSID("$NetBSD: err.c,v 1.41 2009/05/01 22:03:36 christos Exp $");
 #endif
 
 #include <sys/types.h>
@@ -384,6 +384,7 @@
 	"zero sized array is a C99 extension",			      /* 322 */
 	"continue in 'do ... while (0)' loop",			      /* 323 */
 	"suggest cast from '%s' to '%s' on op %s to avoid overflow",  /* 324 */
+	"variable declaration in for loop", 			      /* 325 */
 };
 
 /*

Reply via email to