[c-common.c] warnings: -Wformat and -Wnonnull
DJ Delorie
dj@redhat.com
Fri Jul 22 03:10:00 GMT 2005
More of the same. In these cases, the functions themselves aren't
called unless the warning is enabled. Committed.
Not sure what to do about this one though:
if (warn_format || warn_missing_format_attribute)
check_function_format (attrs, params);
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ChangeLog,v
retrieving revision 2.9510
diff -p -U3 -r2.9510 ChangeLog
--- ChangeLog 22 Jul 2005 02:35:34 -0000 2.9510
+++ ChangeLog 22 Jul 2005 03:04:49 -0000
@@ -4,6 +4,8 @@
call.
* c-typeck.c (parser_build_binary_op): 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>
Index: c-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-common.c,v
retrieving revision 1.646
diff -p -U3 -r1.646 c-common.c
--- c-common.c 20 Jul 2005 01:18:06 -0000 1.646
+++ c-common.c 22 Jul 2005 03:04:49 -0000
@@ -5259,7 +5259,8 @@ check_function_sentinel (tree attrs, tre
}
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
{
tree sentinel, end;
@@ -5281,7 +5282,8 @@ check_function_sentinel (tree attrs, tre
}
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;
}
@@ -5302,7 +5304,7 @@ check_function_sentinel (tree attrs, tre
We warn with -Wstrict-null-sentinel, though. */
&& (warn_strict_null_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 (ct
return;
if (integer_zerop (param))
- warning (0, "null argument where non-null required (argument %lu)",
- (unsigned long) param_num);
+ warning (OPT_Wnonnull, "null argument where non-null required "
+ "(argument %lu)", (unsigned long) param_num);
}
/* Helper for nonnull attribute handling; fetch the operand number
More information about the Gcc-patches
mailing list