diff options
author | Joseph Myers <joseph@codesourcery.com> | 2005-03-20 15:23:50 +0000 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2005-03-20 15:23:50 +0000 |
commit | f6d1c3a69b64edc2ff6d10d8ec89456552a5f3a8 (patch) | |
tree | 4b6f9cfd528a8733782d0ef9c585656d6f4190ce /gcc/c-format.c | |
parent | e498b9f1a0460c20a42d6835470de35d858379da (diff) | |
download | gcc-f6d1c3a69b64edc2ff6d10d8ec89456552a5f3a8.zip gcc-f6d1c3a69b64edc2ff6d10d8ec89456552a5f3a8.tar.gz gcc-f6d1c3a69b64edc2ff6d10d8ec89456552a5f3a8.tar.bz2 |
c-common.c (handle_aligned_attribute, [...]): Do not strip NOPS from INTEGER_CSTs.
* 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.
From-SVN: r96760
Diffstat (limited to 'gcc/c-format.c')
-rw-r--r-- | gcc/c-format.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/gcc/c-format.c b/gcc/c-format.c index 914d6cc..a228b4b 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); |