[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Changes to m4/src/Attic/eval.c,v [branch-1_4]
From: |
Eric Blake |
Subject: |
Changes to m4/src/Attic/eval.c,v [branch-1_4] |
Date: |
Tue, 09 Jan 2007 16:12:45 +0000 |
CVSROOT: /sources/m4
Module name: m4
Branch: branch-1_4
Changes by: Eric Blake <ericb> 07/01/09 16:12:43
Index: src/eval.c
===================================================================
RCS file: /sources/m4/m4/src/Attic/eval.c,v
retrieving revision 1.1.1.1.2.8
retrieving revision 1.1.1.1.2.9
diff -u -b -r1.1.1.1.2.8 -r1.1.1.1.2.9
--- src/eval.c 6 Jan 2007 19:56:11 -0000 1.1.1.1.2.8
+++ src/eval.c 9 Jan 2007 16:12:43 -0000 1.1.1.1.2.9
@@ -34,7 +34,7 @@
PLUS, MINUS,
EXPONENT,
TIMES, DIVIDE, MODULO,
- EQ, NOTEQ, GT, GTEQ, LS, LSEQ,
+ ASSIGN, EQ, NOTEQ, GT, GTEQ, LS, LSEQ,
LSHIFT, RSHIFT,
LNOT, LAND, LOR,
NOT, AND, OR, XOR,
@@ -215,7 +215,7 @@
eval_text++;
return EQ;
}
- return BADOP;
+ return ASSIGN;
case '!':
if (*eval_text == '=')
{
@@ -517,7 +517,10 @@
if ((er = cmp_term (et, v1)) != NO_ERROR)
return er;
- while ((op = eval_lex (&v2)) == EQ || op == NOTEQ)
+ /* In the 1.4.x series, we maintain the traditional behavior that
+ '=' is a synonym for '=='; however, this is contrary to POSIX and
+ we hope to convert '=' to mean assignment in 2.0. */
+ while ((op = eval_lex (&v2)) == EQ || op == NOTEQ || op == ASSIGN)
{
et = eval_lex (&v2);
if (et == ERROR)
@@ -525,6 +528,13 @@
if ((er = cmp_term (et, &v2)) != NO_ERROR)
return er;
+
+ if (op == ASSIGN)
+ {
+ M4ERROR ((warning_status, 0, "\
+Warning: recommend ==, not =, for equality operator"));
+ op = EQ;
+ }
*v1 = (op == EQ) == (*v1 == v2);
}
if (op == ERROR)