Correct internal prototype of __builtin_saveregs
Zack Weinberg
zack@wolery.cumb.org
Wed Aug 2 10:08:00 GMT 2000
When compiling libgcc on targets that don't need a specialized
__builtin_saveregs, we get a warning about no previous prototype for
the function, despite the fact that it's prototyped in libgcc2.h. This
is because the internal declaration has no prototype.
This patch changes c_common_nodes_and_builtins such that __builtin_saveregs
is given a (void) prototype. __builtin_apply_args and __builtin_next_arg
keep their unspecified prototype.
[Are these routines still used? They appear to be only for the old
varargs implementation.]
Bootstrapped i386-linux. OK to commit?
zw
* c-common.c (c_common_nodes_and_builtins): Add ptr_ftype_any
function type. Change ptr_ftype to be void * (void). Give
__builtin_next_arg and __builtin_apply_args ptr_ftype_any.
===================================================================
Index: c-common.c
--- c-common.c 2000/07/31 14:00:34 1.129
+++ c-common.c 2000/08/02 17:06:31
@@ -3424,7 +3424,7 @@ c_common_nodes_and_builtins (cplus_mode,
tree bzero_ftype, bcmp_ftype;
tree endlink, int_endlink, double_endlink, unsigned_endlink;
tree sizetype_endlink;
- tree ptr_ftype, ptr_ftype_unsigned;
+ tree ptr_ftype_any, ptr_ftype, ptr_ftype_unsigned;
tree void_ftype_any, void_ftype_int, int_ftype_any;
tree double_ftype_double, double_ftype_double_double;
tree float_ftype_float, ldouble_ftype_ldouble;
@@ -3465,7 +3465,8 @@ c_common_nodes_and_builtins (cplus_mode,
double_endlink = tree_cons (NULL_TREE, double_type_node, endlink);
unsigned_endlink = tree_cons (NULL_TREE, unsigned_type_node, endlink);
- ptr_ftype = build_function_type (ptr_type_node, NULL_TREE);
+ ptr_ftype_any = build_function_type (ptr_type_node, NULL_TREE);
+ ptr_ftype = build_function_type (ptr_type_node, endlink);
ptr_ftype_unsigned = build_function_type (ptr_type_node, unsigned_endlink);
sizetype_endlink = tree_cons (NULL_TREE, TYPE_DOMAIN (sizetype), endlink);
/* We realloc here because sizetype could be int or unsigned. S'ok. */
@@ -3633,7 +3634,7 @@ c_common_nodes_and_builtins (cplus_mode,
BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_classify_type", default_function_type,
BUILT_IN_CLASSIFY_TYPE, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ("__builtin_next_arg", ptr_ftype, BUILT_IN_NEXT_ARG,
+ builtin_function ("__builtin_next_arg", ptr_ftype_any, BUILT_IN_NEXT_ARG,
BUILT_IN_NORMAL, NULL_PTR);
builtin_function ("__builtin_args_info", int_ftype_int, BUILT_IN_ARGS_INFO,
BUILT_IN_NORMAL, NULL_PTR);
@@ -3667,7 +3668,7 @@ c_common_nodes_and_builtins (cplus_mode,
BUILT_IN_ISUNORDERED, BUILT_IN_NORMAL, NULL_PTR);
/* Untyped call and return. */
- builtin_function ("__builtin_apply_args", ptr_ftype,
+ builtin_function ("__builtin_apply_args", ptr_ftype_any,
BUILT_IN_APPLY_ARGS, BUILT_IN_NORMAL, NULL_PTR);
temp = tree_cons (NULL_TREE,
More information about the Gcc-patches
mailing list