aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-09-07 12:26:58 +0000
committerRichard Stallman <rms@gnu.org>1993-09-07 12:26:58 +0000
commit86463d5d64e4331c4ae0aece37950a5c445d0945 (patch)
tree5af294b53891e7e2190de616ab872227f6dc4e37 /gcc
parent75b46437886a5e33b8cd51201cfa852c82c2f0ec (diff)
downloadgcc-86463d5d64e4331c4ae0aece37950a5c445d0945.zip
gcc-86463d5d64e4331c4ae0aece37950a5c445d0945.tar.gz
gcc-86463d5d64e4331c4ae0aece37950a5c445d0945.tar.bz2
(default_conversion): For enum that's unsigned,
if it's at least as wide as int, convert to an unsigned type. From-SVN: r5272
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-typeck.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 3cea85d..91fff29 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);
}