summaryrefslogtreecommitdiffstats
path: root/usr.bin/m4
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2011-10-16 08:09:17 +0000
committered <ed@FreeBSD.org>2011-10-16 08:09:17 +0000
commit225015e0ef641913f865dee3a9c5e6bc9524d970 (patch)
tree9600e57a5c4edc9635bc5ae1d54b98667ee0a864 /usr.bin/m4
parent7ccc19c3b89a2b9b1fdf8db9bf23a9bcc50026e4 (diff)
downloadFreeBSD-src-225015e0ef641913f865dee3a9c5e6bc9524d970.zip
FreeBSD-src-225015e0ef641913f865dee3a9c5e6bc9524d970.tar.gz
Fix build of m4 with WARNS=6.
Change the parser; rename `exp' to `exponent' not to collide with exp(3).
Diffstat (limited to 'usr.bin/m4')
-rw-r--r--usr.bin/m4/Makefile2
-rw-r--r--usr.bin/m4/expr.c19
-rw-r--r--usr.bin/m4/main.c2
3 files changed, 11 insertions, 12 deletions
diff --git a/usr.bin/m4/Makefile b/usr.bin/m4/Makefile
index feceb0c..702b3f3 100644
--- a/usr.bin/m4/Makefile
+++ b/usr.bin/m4/Makefile
@@ -9,6 +9,4 @@ CFLAGS+=-DEXTENDED
SRCS= eval.c expr.c look.c main.c misc.c gnum4.c trace.c
-WARNS?= 0
-
.include <bsd.prog.mk>
diff --git a/usr.bin/m4/expr.c b/usr.bin/m4/expr.c
index be0f9f9..8f4dd9c 100644
--- a/usr.bin/m4/expr.c
+++ b/usr.bin/m4/expr.c
@@ -71,8 +71,8 @@ __FBSDID("$FreeBSD$");
* nerel : shift { ("<" | ">" | "<=" | ">=") shift }
* shift : primary { ("<<" | ">>") primary }
* primary : term { ("+" | "-") term }
- * term : exp { ("*" | "/" | "%") exp }
- * exp : unary { "**" unary }
+ * term : exponent { ("*" | "/" | "%") exponent }
+ * exponent: unary { "**" unary }
* unary : factor
* | ("+" | "-" | "~" | "!") unary
* factor : constant
@@ -115,12 +115,11 @@ static int nerel(int mayeval);
static int shift(int mayeval);
static int primary(int mayeval);
static int term(int mayeval);
-static int exp(int mayeval);
+static int exponent(int mayeval);
static int unary(int mayeval);
static int factor(int mayeval);
static int constant(int mayeval);
static int num(int mayeval);
-static int geteqrel(int mayeval);
static int skipws(void);
static void experr(const char *);
@@ -388,16 +387,16 @@ primary(int mayeval)
}
/*
- * term : exp { ("*" | "/" | "%") exp }
+ * term : exponent { ("*" | "/" | "%") exponent }
*/
static int
term(int mayeval)
{
int c, vl, vr;
- vl = exp(mayeval);
+ vl = exponent(mayeval);
while ((c = skipws()) == '*' || c == '/' || c == '%') {
- vr = exp(mayeval);
+ vr = exponent(mayeval);
switch (c) {
case '*':
@@ -426,10 +425,10 @@ term(int mayeval)
}
/*
- * exp : unary { "**" exp }
+ * exponent : unary { "**" exponent }
*/
static int
-exp(int mayeval)
+exponent(int mayeval)
{
int c, vl, vr, n;
@@ -562,7 +561,7 @@ constant(int mayeval)
* num : digit | num digit
*/
static int
-num(int mayeval)
+num(int mayeval __unused)
{
int rval, c, base;
int ndig;
diff --git a/usr.bin/m4/main.c b/usr.bin/m4/main.c
index 99f5233..0e60fce 100644
--- a/usr.bin/m4/main.c
+++ b/usr.bin/m4/main.c
@@ -34,9 +34,11 @@
*/
#ifndef lint
+#if 0
static char copyright[] =
"@(#) Copyright (c) 1989, 1993\n\
The Regents of the University of California. All rights reserved.\n";
+#endif
#endif /* not lint */
#ifndef lint
OpenPOWER on IntegriCloud