aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1993-08-30 16:13:42 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1993-08-30 16:13:42 -0400
commitfd48df3e75dbf1e7ab370d8d1aecbf522cfc893c (patch)
tree1f460e4980480c8140f1938ad5312c77b322533a /gcc/c-decl.c
parent37c37a579c115ca41cef4bf760be77ed9e311e23 (diff)
downloadgcc-fd48df3e75dbf1e7ab370d8d1aecbf522cfc893c.zip
gcc-fd48df3e75dbf1e7ab370d8d1aecbf522cfc893c.tar.gz
gcc-fd48df3e75dbf1e7ab370d8d1aecbf522cfc893c.tar.bz2
(get_parm_info...
(get_parm_info, store_parm_decls): If PROMOTE_PROTOTYPE, promote all integral types shorter than int, including short enums. From-SVN: r5228
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 62f77e9..d9eb67d 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -4883,7 +4883,8 @@ get_parm_info (void_at_end)
tree type = TREE_TYPE (decl);
DECL_ARG_TYPE (decl) = type;
#ifdef PROMOTE_PROTOTYPES
- if (TREE_CODE (type) == INTEGER_TYPE
+ if ((TREE_CODE (type) == INTEGER_TYPE
+ || TREE_CODE (type) == ENUMERAL_TYPE)
&& TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node))
DECL_ARG_TYPE (decl) = integer_type_node;
#endif
@@ -6094,7 +6095,8 @@ store_parm_decls ()
useful for argument types like uid_t. */
DECL_ARG_TYPE (parm) = TREE_TYPE (parm);
#ifdef PROMOTE_PROTOTYPES
- if (TREE_CODE (TREE_TYPE (parm)) == INTEGER_TYPE
+ if ((TREE_CODE (TREE_TYPE (parm)) == INTEGER_TYPE
+ || TREE_CODE (TREE_TYPE (parm)) == ENUMERAL_TYPE)
&& TYPE_PRECISION (TREE_TYPE (parm))
< TYPE_PRECISION (integer_type_node))
DECL_ARG_TYPE (parm) = integer_type_node;