summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/pcc/cpp/scanner.l11
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.bin/pcc/cpp/scanner.l b/usr.bin/pcc/cpp/scanner.l
index 035127fb0fb..bf615db40f2 100644
--- a/usr.bin/pcc/cpp/scanner.l
+++ b/usr.bin/pcc/cpp/scanner.l
@@ -1,5 +1,5 @@
%{
-/* $Id: scanner.l,v 1.4 2007/10/27 12:50:50 ragge Exp $ */
+/* $OpenBSD: scanner.l,v 1.5 2007/11/10 22:14:15 stefan Exp $ */
/*
* Copyright (c) 2004 Anders Magnusson. All rights reserved.
@@ -51,6 +51,7 @@ static void undefstmt(void);
static void cpperror(void);
static void elifstmt(void);
static void storepb(void);
+static void badop(const char *);
void include(void);
void define(void);
@@ -138,6 +139,8 @@ WS [\t ]
"\r" { ; /* Ignore CR's */ }
+<IFR>"++" { badop("++"); }
+<IFR>"--" { badop("--"); }
<IFR>"==" { return EQ; }
<IFR>"!=" { return NE; }
<IFR>"<=" { return LE; }
@@ -828,3 +831,9 @@ pragmastmt(void)
prtline();
slow = 0;
}
+
+static void
+badop(const char *op)
+{
+ error("invalid operator in preprocessor expression: %s", op);
+}