summaryrefslogtreecommitdiffstats
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>1999-08-02 23:17:06 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>1999-08-02 23:17:06 +0000
commit635ff2b73ca9e68ef0509008c9d261b4efc55f8d (patch)
tree7a67b77ab73f97ff628e4f1a4e684f4e27bea700 /gcc/c-decl.c
parentbf5e670001a032c33b28f779088b8915c883f2f6 (diff)
downloadppe42-gcc-635ff2b73ca9e68ef0509008c9d261b4efc55f8d.tar.gz
ppe42-gcc-635ff2b73ca9e68ef0509008c9d261b4efc55f8d.zip
Jakub Jelinek <jj@ultra.linux.cz>
* c-decl.c (get_parm_info, store_parm_decls): Change all uses of PROMOTE_PROTOTYPES, so that it tests it as a C expression. Ensure expr.h is included. * c-typecheck.c (convert_arguments): Ditto. * expr.h: Supply default for PROMOTE_PROTOTYPES (0). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@28420 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index fd573340e1e..2c1dacdbccc 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -34,6 +34,7 @@ Boston, MA 02111-1307, USA. */
#include "c-tree.h"
#include "c-lex.h"
#include "toplev.h"
+#include "expr.h"
#if USE_CPPLIB
#include "cpplib.h"
@@ -5219,12 +5220,11 @@ get_parm_info (void_at_end)
args are passed in their declared types. */
tree type = TREE_TYPE (decl);
DECL_ARG_TYPE (decl) = type;
-#ifdef PROMOTE_PROTOTYPES
- if ((TREE_CODE (type) == INTEGER_TYPE
- || TREE_CODE (type) == ENUMERAL_TYPE)
+ if (PROMOTE_PROTOTYPES
+ && (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
types = saveable_tree_cons (NULL_TREE, TREE_TYPE (decl), types);
if (TYPE_MAIN_VARIANT (TREE_VALUE (types)) == void_type_node && ! erred
@@ -6557,13 +6557,14 @@ store_parm_decls ()
`int foo(float x) {...}'. This is particularly
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
- || TREE_CODE (TREE_TYPE (parm)) == ENUMERAL_TYPE)
+
+ if (PROMOTE_PROTOTYPES
+ && (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;
-#endif
+
if (pedantic)
{
pedwarn ("promoted argument `%s' doesn't match prototype",
OpenPOWER on IntegriCloud