From 86463d5d64e4331c4ae0aece37950a5c445d0945 Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Tue, 7 Sep 1993 12:26:58 +0000 Subject: [PATCH] (default_conversion): For enum that's unsigned, if it's at least as wide as int, convert to an unsigned type. From-SVN: r5272 --- gcc/c-typeck.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 3cea85d62e3..91fff295349 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -944,7 +944,9 @@ default_conversion (exp) { type = type_for_size (MAX (TYPE_PRECISION (type), TYPE_PRECISION (integer_type_node)), - (flag_traditional && TREE_UNSIGNED (type))); + ((flag_traditional + || TYPE_PRECISION (type) >= TYPE_PRECISION (integer_type_node)) + && TREE_UNSIGNED (type))); return convert (type, exp); } -- 2.30.2