aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-08-21 06:05:17 +0000
committerRichard Stallman <rms@gnu.org>1992-08-21 06:05:17 +0000
commitedc7c4ec3b1ea05e7340860781702daddf34f024 (patch)
treebadb94b873bb0aa59e9f54b3b5fe18e18bcab4cb
parent3bf1c6b55c2ce09960809f20234828c591f3b300 (diff)
downloadgcc-edc7c4ec3b1ea05e7340860781702daddf34f024.zip
gcc-edc7c4ec3b1ea05e7340860781702daddf34f024.tar.gz
gcc-edc7c4ec3b1ea05e7340860781702daddf34f024.tar.bz2
(parser_build_binary_op): Replace the assignment of CLASS.
For Z<Y<Z warning, test class of CODE; don't use TREE_CODE (result). From-SVN: r1921
-rw-r--r--gcc/c-typeck.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 96bacec..6a52b41 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -2066,7 +2066,7 @@ convert_arguments (typelist, values, name)
In addition to constructing the expression,
we check for operands that were written with other binary operators
in a way that is likely to confuse the user. */
-
+
tree
parser_build_binary_op (code, arg1, arg2)
enum tree_code code;
@@ -2132,13 +2132,13 @@ parser_build_binary_op (code, arg1, arg2)
}
}
- class = TREE_CODE_CLASS (TREE_CODE (result));
-
/* Similarly, check for cases like 1<=i<=10 that are probably errors. */
- if (class == '<' && extra_warnings
+ if (TREE_CODE_CLASS (code) == '<' && extra_warnings
&& (TREE_CODE_CLASS (code1) == '<' || TREE_CODE_CLASS (code2) == '<'))
warning ("comparisons like X<=Y<=Z do not have their mathematical meaning");
+ class = TREE_CODE_CLASS (TREE_CODE (result));
+
/* Record the code that was specified in the source,
for the sake of warnings about confusing nesting. */
if (class == 'e' || class == '1'