Commit 30480ec4 by DJ Delorie Committed by DJ Delorie

... Add warning control to warning call.

* c-common.c (check_function_sentinel): Likewise.
(check_nonnull_arg): Likewise.

From-SVN: r102266
parent c303630a
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
call. call.
* c-typeck.c (parser_build_binary_op): Likewise. * c-typeck.c (parser_build_binary_op): Likewise.
(c_finish_if_stmt): Likewise. (c_finish_if_stmt): Likewise.
* c-common.c (check_function_sentinel): Likewise.
(check_nonnull_arg): Likewise.
2005-07-21 Richard Henderson <rth@redhat.com> 2005-07-21 Richard Henderson <rth@redhat.com>
......
...@@ -5259,7 +5259,8 @@ check_function_sentinel (tree attrs, tree params, tree typelist) ...@@ -5259,7 +5259,8 @@ check_function_sentinel (tree attrs, tree params, tree typelist)
} }
if (typelist || !params) if (typelist || !params)
warning (0, "not enough variable arguments to fit a sentinel"); warning (OPT_Wformat,
"not enough variable arguments to fit a sentinel");
else else
{ {
tree sentinel, end; tree sentinel, end;
...@@ -5281,7 +5282,8 @@ check_function_sentinel (tree attrs, tree params, tree typelist) ...@@ -5281,7 +5282,8 @@ check_function_sentinel (tree attrs, tree params, tree typelist)
} }
if (pos > 0) if (pos > 0)
{ {
warning (0, "not enough variable arguments to fit a sentinel"); warning (OPT_Wformat,
"not enough variable arguments to fit a sentinel");
return; return;
} }
...@@ -5302,7 +5304,7 @@ check_function_sentinel (tree attrs, tree params, tree typelist) ...@@ -5302,7 +5304,7 @@ check_function_sentinel (tree attrs, tree params, tree typelist)
We warn with -Wstrict-null-sentinel, though. */ We warn with -Wstrict-null-sentinel, though. */
&& (warn_strict_null_sentinel && (warn_strict_null_sentinel
|| null_node != TREE_VALUE (sentinel))) || null_node != TREE_VALUE (sentinel)))
warning (0, "missing sentinel in function call"); warning (OPT_Wformat, "missing sentinel in function call");
} }
} }
} }
...@@ -5344,8 +5346,8 @@ check_nonnull_arg (void * ARG_UNUSED (ctx), tree param, ...@@ -5344,8 +5346,8 @@ check_nonnull_arg (void * ARG_UNUSED (ctx), tree param,
return; return;
if (integer_zerop (param)) if (integer_zerop (param))
warning (0, "null argument where non-null required (argument %lu)", warning (OPT_Wnonnull, "null argument where non-null required "
(unsigned long) param_num); "(argument %lu)", (unsigned long) param_num);
} }
/* Helper for nonnull attribute handling; fetch the operand number /* Helper for nonnull attribute handling; fetch the operand number
......
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