summaryrefslogtreecommitdiff
path: root/usr.bin/xlint
diff options
context:
space:
mode:
authorChad Loder <cloder@cvs.openbsd.org>2005-11-23 22:25:38 +0000
committerChad Loder <cloder@cvs.openbsd.org>2005-11-23 22:25:38 +0000
commit76264b8254f001c6f7320acf405abb71b5d7106c (patch)
treed1799e9288eac9c875bd847d0cb1cfd86b4ec082 /usr.bin/xlint
parent37c4506f5384e1dea0e42bc3f1dcca2b2a25ca31 (diff)
Deal somewhat with case ranges, which is a gcc extension.
"fine" deraadt, with his suggested modifications
Diffstat (limited to 'usr.bin/xlint')
-rw-r--r--usr.bin/xlint/lint1/cgram.y12
-rw-r--r--usr.bin/xlint/lint1/err.c5
2 files changed, 13 insertions, 4 deletions
diff --git a/usr.bin/xlint/lint1/cgram.y b/usr.bin/xlint/lint1/cgram.y
index 9d5e14746b6..7fe0268d8e0 100644
--- a/usr.bin/xlint/lint1/cgram.y
+++ b/usr.bin/xlint/lint1/cgram.y
@@ -1,5 +1,5 @@
%{
-/* $OpenBSD: cgram.y,v 1.8 2005/11/23 18:47:40 cloder Exp $ */
+/* $OpenBSD: cgram.y,v 1.9 2005/11/23 22:25:36 cloder Exp $ */
/* $NetBSD: cgram.y,v 1.8 1995/10/02 17:31:35 jpo Exp $ */
/*
@@ -34,7 +34,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: cgram.y,v 1.8 2005/11/23 18:47:40 cloder Exp $";
+static char rcsid[] = "$OpenBSD: cgram.y,v 1.9 2005/11/23 22:25:36 cloder Exp $";
#endif
#include <stdlib.h>
@@ -1210,6 +1210,14 @@ label:
label(T_CASE, NULL, $2);
ftflg = 1;
}
+ | T_CASE constant T_ELLIPSE constant T_COLON {
+ /* XXX: only using the first value of this gcc-ism */
+ label(T_CASE, NULL, $2);
+ ftflg = 1;
+
+ if (!gflag)
+ gnuism(311);
+ }
| T_DEFAULT T_COLON {
label(T_DEFAULT, NULL, NULL);
ftflg = 1;
diff --git a/usr.bin/xlint/lint1/err.c b/usr.bin/xlint/lint1/err.c
index b54d7475cb8..c7267d39352 100644
--- a/usr.bin/xlint/lint1/err.c
+++ b/usr.bin/xlint/lint1/err.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: err.c,v 1.10 2005/11/23 00:12:13 cloder Exp $ */
+/* $OpenBSD: err.c,v 1.11 2005/11/23 22:25:37 cloder Exp $ */
/* $NetBSD: err.c,v 1.8 1995/10/02 17:37:00 jpo Exp $ */
/*
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: err.c,v 1.10 2005/11/23 00:12:13 cloder Exp $";
+static char rcsid[] = "$OpenBSD: err.c,v 1.11 2005/11/23 22:25:37 cloder Exp $";
#endif
/* number of errors found */
@@ -364,6 +364,7 @@ const char *msgs[] = {
"", /* 308 */
"extra bits set to 0 in conversion of '%s' to '%s', op %s", /* 309 */
"right shift of %d-bit quantity by %d bits", /* 310 */
+ "case ranges are illegal in ANSI C", /* 311 */
};
/*