From dbf6c367801e1bf1d0cec09a2fe8fef7f7957c3f Mon Sep 17 00:00:00 2001 From: thorpej Date: Thu, 23 May 2002 15:48:05 +0000 Subject: * c-common.c (warn_nonnull): Declare. (c_common_attribute_table): Add "nonnull" attribute. (handle_nonnull_attribute, check_function_nonnull, nonnull_check_p, check_nonnull_arg, get_nonnull_operand, check_function_arguments, check_function_arguments_recurse): New functions. * c-common.h (warn_nonnull): Declare extern. (check_function_arguments, check_function_arguments_recurse): New prototypes. * c-decl.c (c_decode_option): Add -Wnonnull option. * c-format.c (set_Wformat): Set warn_nonnull if enabling format checking. (format_check_context): New structure. (check_format_info_recurse): Remove recursion and rename to... (check_format_arg): ...this. Update comment. (check_format_info): Use check_function_arguments_recurse. * c-typeck.c (build_function_call): Call check_function_arguments instead of check_function_format. * doc/extend.texi: Document "nonnull" attribute. * doc/invoke.texi: Docuemnt -Wnonnull option. * testsuite/gcc.dg/nonnull-1.c: New test. * testsuite/gcc.dg/nonnull-2.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53790 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/c-decl.c | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/c-decl.c') diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 0890a2a58c4..3dcb05540ec 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -489,6 +489,7 @@ c_decode_option (argc, argv) { "missing-prototypes", &warn_missing_prototypes }, { "multichar", &warn_multichar }, { "nested-externs", &warn_nested_externs }, + { "nonnull", &warn_nonnull }, { "parentheses", &warn_parentheses }, { "pointer-arith", &warn_pointer_arith }, { "redundant-decls", &warn_redundant_decls }, -- cgit v1.2.3