Commit dd66b8e8 by Joseph Myers Committed by Joseph Myers

call.c (build_over_call), [...]): Call check_function_arguments instead of check_function_format.

cp:
	* call.c (build_over_call), typeck.c (build_function_call): Call
	check_function_arguments instead of check_function_format.

testsuite:
	* g++.dg/warn/nonnull1.C: New test.

From-SVN: r83937
parent 0671a8a0
2004-06-30 Joseph S. Myers <jsm@polyomino.org.uk> 2004-06-30 Joseph S. Myers <jsm@polyomino.org.uk>
* call.c (build_over_call), typeck.c (build_function_call): Call
check_function_arguments instead of check_function_format.
2004-06-30 Joseph S. Myers <jsm@polyomino.org.uk>
* call.c (build_over_call), typeck.c (build_function_call): Update * call.c (build_over_call), typeck.c (build_function_call): Update
calls to check_function_format. calls to check_function_format.
......
...@@ -4723,8 +4723,7 @@ build_over_call (struct z_candidate *cand, int flags) ...@@ -4723,8 +4723,7 @@ build_over_call (struct z_candidate *cand, int flags)
converted_args = nreverse (converted_args); converted_args = nreverse (converted_args);
if (warn_format) check_function_arguments (TYPE_ATTRIBUTES (TREE_TYPE (fn)),
check_function_format (TYPE_ATTRIBUTES (TREE_TYPE (fn)),
converted_args); converted_args);
/* Avoid actually calling copy constructors and copy assignment operators, /* Avoid actually calling copy constructors and copy assignment operators,
......
...@@ -2483,10 +2483,10 @@ build_function_call (tree function, tree params) ...@@ -2483,10 +2483,10 @@ build_function_call (tree function, tree params)
if (coerced_params == error_mark_node) if (coerced_params == error_mark_node)
return error_mark_node; return error_mark_node;
/* Check for errors in format strings. */ /* Check for errors in format strings and inappropriately
null parameters. */
if (warn_format) check_function_arguments (TYPE_ATTRIBUTES (fntype), coerced_params);
check_function_format (TYPE_ATTRIBUTES (fntype), coerced_params);
return build_cxx_call (function, coerced_params); return build_cxx_call (function, coerced_params);
} }
......
2004-06-30 Joseph S. Myers <jsm@polyomino.org.uk>
* g++.dg/warn/nonnull1.C: New test.
2004-06-30 Eric Botcazou <ebotcazou@libertysurf.fr> 2004-06-30 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.dg/compat/compat-common.h: Wrap up CINT in * gcc.dg/compat/compat-common.h: Wrap up CINT in
......
// Test that "nonnull" attribute works for C++.
// Origin: Joseph Myers <jsm@polyomino.org.uk>
// { dg-do compile }
// { dg-options "-Wall" }
// The "nonnull" attribute is thoroughly tested for C, so here we
// simply test that it works at all, as at one point the relevant
// checking code was only called for C.
extern void f (char *) __attribute__((nonnull));
void
g ()
{
f (0); // { dg-warning "null" "null argument" }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment