From 74ff46299b5d4b97dc736fc77fb3a2618c119e85 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Tue, 17 Oct 2000 07:52:06 +0100 Subject: c-common.h (warn_missing_format_attribute): New variable. * c-common.h (warn_missing_format_attribute): New variable. * c-decl.c (warn_missing_format_attribute): New variable. (c_decode_option): Decode -Wmissing-format-attribute and -Wno-missing-format-attribute. * c-common.c (check_function_format): If -Wmissing-format-attribute, give a warning where a vprintf or vscanf function is called by a function without its own printf or scanf attribute. * toplev.c (documented_lang_options): Add -Wmissing-format-attribute. * invoke.texi: Document -Wmissing-format-attribute. cp: * decl2.c (warn_missing_format_attribute): New variable. (lang_decode_option): Decode -Wmissing-format-attribute. testsuite: * gcc.dg/format-miss-1.c: New test. From-SVN: r36897 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/decl2.c | 6 ++++++ 2 files changed, 11 insertions(+) (limited to 'gcc/cp') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 262405c..b9c74ad 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2000-10-17 Joseph S. Myers + + * decl2.c (warn_missing_format_attribute): New variable. + (lang_decode_option): Decode -Wmissing-format-attribute. + 2000-10-16 Mark Mitchell * typeck.c (qualify_type): Remove. diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 93c1be4..4f6b57e 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -290,6 +290,10 @@ int warn_float_equal = 0; int warn_format; +/* Warn about functions which might be candidates for format attributes. */ + +int warn_missing_format_attribute; + /* Warn about a subscript that has type char. */ int warn_char_subscripts; @@ -751,6 +755,8 @@ lang_decode_option (argc, argv) warn_float_equal = setting; else if (!strcmp (p, "format")) warn_format = setting; + else if (!strcmp (p, "missing-format-attribute")) + warn_missing_format_attribute = setting; else if (!strcmp (p, "conversion")) warn_conversion = setting; else if (!strcmp (p, "parentheses")) -- cgit v1.1