summaryrefslogtreecommitdiffstats
path: root/gcc/c-typeck.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-04-30 23:59:10 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-04-30 23:59:10 +0000
commitd7aeef064b119c2cf94d12caee985d48906522ee (patch)
tree1e7389002ae91d660ddd3c0a718444a33765d0ae /gcc/c-typeck.c
parent050a74c94d4a1b15c519caf043001f58fb84295e (diff)
downloadppe42-gcc-d7aeef064b119c2cf94d12caee985d48906522ee.tar.gz
ppe42-gcc-d7aeef064b119c2cf94d12caee985d48906522ee.zip
* c-common.c (c_promoting_integer_type_p): New function, from the
corpse of old macro. Properly promote too-small enumerations and booleans. Adjust all callers. * c-common.h (C_PROMOTING_INTEGER_TYPE_P): Remove. (c_promoting_integer_type_p): Declare. * c-decl.c: Adjust C_PROMOTING_INTEGER_TYPE_P invocations. * c-typeck.c: Likewise. (default_conversion): Remove now redundant boolean check. * cvt.c: Downcase C_PROMOTING_INTEGER_TYPE_P invocations. * decl.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41709 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-typeck.c')
-rw-r--r--gcc/c-typeck.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index baf5fed2d07..f05422ca6d2 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -954,14 +954,14 @@ default_conversion (exp)
if (TREE_CODE (exp) == COMPONENT_REF
&& DECL_C_BIT_FIELD (TREE_OPERAND (exp, 1))
/* If it's thinner than an int, promote it like a
- C_PROMOTING_INTEGER_TYPE_P, otherwise leave it alone. */
+ c_promoting_integer_type_p, otherwise leave it alone. */
&& 0 > compare_tree_int (DECL_SIZE (TREE_OPERAND (exp, 1)),
TYPE_PRECISION (integer_type_node)))
return convert (flag_traditional && TREE_UNSIGNED (type)
? unsigned_type_node : integer_type_node,
exp);
- if (C_PROMOTING_INTEGER_TYPE_P (type))
+ if (c_promoting_integer_type_p (type))
{
/* Traditionally, unsignedness is preserved in default promotions.
Also preserve unsignedness if not really getting any wider. */
@@ -973,9 +973,6 @@ default_conversion (exp)
return convert (integer_type_node, exp);
}
- if (code == BOOLEAN_TYPE)
- return convert (integer_type_node, exp);
-
if (flag_traditional && !flag_allow_single_precision
&& TYPE_MAIN_VARIANT (type) == float_type_node)
return convert (double_type_node, exp);
OpenPOWER on IntegriCloud