summaryrefslogtreecommitdiff
path: root/gcc/c-format.c
diff options
context:
space:
mode:
authorSandra Loosemore <sandra@codesourcery.com>2007-02-28 14:21:20 -0500
committerSandra Loosemore <sandra@gcc.gnu.org>2007-02-28 14:21:20 -0500
commit94a0dd7b599e1d83b81f007258af2b16e7cbc4c5 (patch)
tree34dad42b40269284ec633fd80ce8a06342ba7ea3 /gcc/c-format.c
parent76bf4853ce24034b8489b3b5ba56d1de50203ea5 (diff)
downloadgcc-94a0dd7b599e1d83b81f007258af2b16e7cbc4c5.tar.gz
builtins.c (fold_builtin_call_list, [...]): Delete, and replace with...
2007-02-28 Sandra Loosemore <sandra@codesourcery.com> * gcc/builtins.c (fold_builtin_call_list, fold_builtin_call_valist): Delete, and replace with... (fold_builtin_call_array): This. Update callers to use it. * gcc/fold-const.c (fold_build_call_list): Delete, and replace with... (fold_build_call_array): This. (fold_build_call_list_initializer): Delete, and replace with... (fold_build_call_array_initializer): This. * gcc/tree.h: Update declarations to reflect above changes. * gcc/c-typeck.c (build_function_call): Store converted arguments in a stack-allocated array instead of building a list. (convert_arguments): Store arguments in the array passed in as an argument, and return the actual number of arguments. * gcc/c-format.c: (check_function_format): Pass arguments in an array instead of a list. * gcc/c-common.c (check_function_nonnull): Likewise. (check_function_sentinel): Likewise. (check_function_arguments): Likewise. * gcc/c-common.h: Update declarations to reflect above changes. * gcc/cp/typeck.c (build_function_call): Store converted arguments in a stack-allocated array instead of building a list. (convert_arguments): Store arguments in the array passed in as an argument, and return the actual number of arguments. * gcc/cp/call.c (build_call): Delete, and replace with... (build_call_n, build_call_a): New. (build_op_delete_call): Rewrite to avoid constructing argument lists. (build_over_call): Store converted arguments in a stack-allocated array instead of building a list. (build_cxx_call): Pass arguments in an array instead of as a list. (build_java_interface_fn_ref): Rewrite to avoid constructing argument lists. * gcc/cp/tree.h: Update declarations to reflect above changes. * gcc/cp/method.c (use_thunk): Use a stack-allocated array to hold the arguments instead of a list. * gcc/cp/rtti.c (throw_bad_cast): Update call to cxx_call. (throw_bad_typeid): Likewise. (build_dynamic_cast_1): Likewise. * gcc/cp/init.c (build_builtin_delete_call): Use build_call_n. * gcc/cp/decl.c (expand_static_init): Likewise. * gcc/cp/except.c (cp_protect_cleanup_actions): Likewise. * gcc/cp/cp-gimplify.c (genericize_eh_spec_block): Likewise. (gimplify_must_not_throw_expr): Likewise. (cxx_omp_apply_fn): Use build_call_a. From-SVN: r122411
Diffstat (limited to 'gcc/c-format.c')
-rw-r--r--gcc/c-format.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/c-format.c b/gcc/c-format.c
index 403724e5e11..4a0a41e3a54 100644
--- a/gcc/c-format.c
+++ b/gcc/c-format.c
@@ -851,13 +851,14 @@ decode_format_type (const char *s)
/* Check the argument list of a call to printf, scanf, etc.
- ATTRS are the attributes on the function type.
- PARAMS is the list of argument values. Also, if -Wmissing-format-attribute,
+ ATTRS are the attributes on the function type. There are NARGS argument
+ values in the array ARGARRAY.
+ Also, if -Wmissing-format-attribute,
warn for calls to vprintf or vscanf in functions with no such format
attribute themselves. */
void
-check_function_format (tree attrs, tree params)
+check_function_format (tree attrs, int nargs, tree *argarray)
{
tree a;
@@ -870,7 +871,16 @@ check_function_format (tree attrs, tree params)
function_format_info info;
decode_format_attr (TREE_VALUE (a), &info, 1);
if (warn_format)
- check_format_info (&info, params);
+ {
+ /* FIXME: Rewrite all the internal functions in this file
+ to use the ARGARRAY directly instead of constructing this
+ temporary list. */
+ tree params = NULL_TREE;
+ int i;
+ for (i = nargs - 1; i >= 0; i--)
+ params = tree_cons (NULL_TREE, argarray[i], params);
+ check_format_info (&info, params);
+ }
if (warn_missing_format_attribute && info.first_arg_num == 0
&& (format_types[info.format_type].flags
& (int) FMT_FLAG_ARG_CONVERT))