OSDN Git Service

(default_conversion): For enum that's unsigned,
authorrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 7 Sep 1993 12:26:58 +0000 (12:26 +0000)
committerrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 7 Sep 1993 12:26:58 +0000 (12:26 +0000)
if it's at least as wide as int, convert to an unsigned type.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@5272 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/c-typeck.c

index 3cea85d..91fff29 100644 (file)
@@ -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);
     }