aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-09-05 02:01:30 +0000
committerRichard Stallman <rms@gnu.org>1992-09-05 02:01:30 +0000
commit9e9bd45dd934c75a7f0601ebd193388adca001f4 (patch)
tree069c4cdd86e6139317f534fdca40bbd3433dd79a /gcc
parent9682683d886a6af57ad62fee36a74c6a22cdf939 (diff)
downloadgcc-9e9bd45dd934c75a7f0601ebd193388adca001f4.zip
gcc-9e9bd45dd934c75a7f0601ebd193388adca001f4.tar.gz
gcc-9e9bd45dd934c75a7f0601ebd193388adca001f4.tar.bz2
(constant_expression_warning): Check INTEGER_CST for TREE_CONSTANT_OVERFLOW.
From-SVN: r2052
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-typeck.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 6f71cb6..6a0247a 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -786,14 +786,13 @@ c_alignof (type)
return size_int (TYPE_ALIGN (type) / BITS_PER_UNIT);
}
-/* Print a warning if a constant expression had overflow in folding.
- This doesn't really work--it is waiting for changes in fold. */
+/* Print a warning if a constant expression had overflow in folding. */
void
constant_expression_warning (value)
tree value;
{
- if (TREE_CODE (value) == NON_LVALUE_EXPR && TREE_CONSTANT_OVERFLOW (value))
+ if (TREE_CODE (value) == INTEGER_CST && TREE_CONSTANT_OVERFLOW (value))
pedwarn ("overflow in constant expression");
}
@@ -801,6 +800,7 @@ constant_expression_warning (value)
alignment of EXPR, measured in bytes. For VAR_DECL's and
FIELD_DECL's return DECL_ALIGN (which can be set from an
"aligned" __attribute__ specification). */
+
tree
c_alignof_expr (expr)
tree expr;