summaryrefslogtreecommitdiff
path: root/gcc/c-format.c
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-20 15:23:50 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-20 15:23:50 +0000
commit67409385de6e36bd5b6bd23d81adbf06b3cd12ad (patch)
tree4b6f9cfd528a8733782d0ef9c585656d6f4190ce /gcc/c-format.c
parent7169af5411c7f5266e69d0d175ea51203860a713 (diff)
downloadgcc-67409385de6e36bd5b6bd23d81adbf06b3cd12ad.tar.gz
* c-common.c (handle_aligned_attribute, check_function_sentinel,
get_nonnull_operand, handle_sentinel_attribute, check_function_arguments_recurse): Do not strip NOPS from INTEGER_CSTs. * c-decl.c (check_bitfield_type_and_width, build_enumerator): Likewise. * c-format.c (get_constant): Likewise. * c-parser.c (c_parser_postfix_expression): Likewise. * c-typeck.c (set_init_index): Likewise. (convert_arguments): Don't check for NOP_EXPR containing integer constant. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96760 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-format.c')
-rw-r--r--gcc/c-format.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/gcc/c-format.c b/gcc/c-format.c
index 914d6cc9792..a228b4b886f 100644
--- a/gcc/c-format.c
+++ b/gcc/c-format.c
@@ -147,17 +147,12 @@ check_format_string (tree argument, unsigned HOST_WIDE_INT format_num,
return true;
}
-/* Strip any conversions from the expression, verify it is a constant,
- and store its value. If validated_p is true, abort on errors.
+/* Verify EXPR is a constant, and store its value.
+ If validated_p is true, abort on errors.
Returns true on success, false otherwise. */
static bool
get_constant (tree expr, unsigned HOST_WIDE_INT *value, int validated_p)
{
- while (TREE_CODE (expr) == NOP_EXPR
- || TREE_CODE (expr) == CONVERT_EXPR
- || TREE_CODE (expr) == NON_LVALUE_EXPR)
- expr = TREE_OPERAND (expr, 0);
-
if (TREE_CODE (expr) != INTEGER_CST || TREE_INT_CST_HIGH (expr) != 0)
{
gcc_assert (!validated_p);