From owner-svn-src-all@FreeBSD.ORG Sun Oct 16 08:09:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1092106564A; Sun, 16 Oct 2011 08:09:17 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6BA78FC0A; Sun, 16 Oct 2011 08:09:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9G89HC4052276; Sun, 16 Oct 2011 08:09:17 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9G89Hlq052272; Sun, 16 Oct 2011 08:09:17 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201110160809.p9G89Hlq052272@svn.freebsd.org> From: Ed Schouten Date: Sun, 16 Oct 2011 08:09:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226422 - head/usr.bin/m4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Oct 2011 08:09:18 -0000 Author: ed Date: Sun Oct 16 08:09:17 2011 New Revision: 226422 URL: http://svn.freebsd.org/changeset/base/226422 Log: Fix build of m4 with WARNS=6. Change the parser; rename `exp' to `exponent' not to collide with exp(3). Modified: head/usr.bin/m4/Makefile head/usr.bin/m4/expr.c head/usr.bin/m4/main.c Modified: head/usr.bin/m4/Makefile ============================================================================== --- head/usr.bin/m4/Makefile Sun Oct 16 08:04:43 2011 (r226421) +++ head/usr.bin/m4/Makefile Sun Oct 16 08:09:17 2011 (r226422) @@ -9,6 +9,4 @@ CFLAGS+=-DEXTENDED SRCS= eval.c expr.c look.c main.c misc.c gnum4.c trace.c -WARNS?= 0 - .include Modified: head/usr.bin/m4/expr.c ============================================================================== --- head/usr.bin/m4/expr.c Sun Oct 16 08:04:43 2011 (r226421) +++ head/usr.bin/m4/expr.c Sun Oct 16 08:09:17 2011 (r226422) @@ -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; Modified: head/usr.bin/m4/main.c ============================================================================== --- head/usr.bin/m4/main.c Sun Oct 16 08:04:43 2011 (r226421) +++ head/usr.bin/m4/main.c Sun Oct 16 08:09:17 2011 (r226422) @@ -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