Commit 96571883 by Brendan Kehoe

Moved constant_expression_warning into c-common.c.

From-SVN: r2076
parent 2a23183e
...@@ -281,6 +281,16 @@ decl_attributes (decl, attributes) ...@@ -281,6 +281,16 @@ decl_attributes (decl, attributes)
} }
} }
/* Print a warning if a constant expression had overflow in folding. */
void
constant_expression_warning (value)
tree value;
{
if (TREE_CODE (value) == INTEGER_CST && TREE_CONSTANT_OVERFLOW (value))
pedwarn ("overflow in constant expression");
}
void void
c_expand_expr_stmt (expr) c_expand_expr_stmt (expr)
tree expr; tree expr;
......
...@@ -785,16 +785,6 @@ c_alignof (type) ...@@ -785,16 +785,6 @@ c_alignof (type)
return size_int (TYPE_ALIGN (type) / BITS_PER_UNIT); return size_int (TYPE_ALIGN (type) / BITS_PER_UNIT);
} }
/* Print a warning if a constant expression had overflow in folding. */
void
constant_expression_warning (value)
tree value;
{
if (TREE_CODE (value) == INTEGER_CST && TREE_CONSTANT_OVERFLOW (value))
pedwarn ("overflow in constant expression");
}
/* Implement the __alignof keyword: Return the minimum required /* Implement the __alignof keyword: Return the minimum required
alignment of EXPR, measured in bytes. For VAR_DECL's and alignment of EXPR, measured in bytes. For VAR_DECL's and
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment