diff options
author | Joseph Myers <jsm28@cam.ac.uk> | 2000-10-17 07:52:06 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2000-10-17 07:52:06 +0100 |
commit | 74ff46299b5d4b97dc736fc77fb3a2618c119e85 (patch) | |
tree | 0d78db7f736f6806e242f06d781a29dd0b8f8ae2 /gcc/cp | |
parent | 1d3b0e2c196a53b8d0e0b8ecabf5b110f666c442 (diff) | |
download | gcc-74ff46299b5d4b97dc736fc77fb3a2618c119e85.zip gcc-74ff46299b5d4b97dc736fc77fb3a2618c119e85.tar.gz gcc-74ff46299b5d4b97dc736fc77fb3a2618c119e85.tar.bz2 |
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
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 6 |
2 files changed, 11 insertions, 0 deletions
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 <jsm28@cam.ac.uk> + + * decl2.c (warn_missing_format_attribute): New variable. + (lang_decode_option): Decode -Wmissing-format-attribute. + 2000-10-16 Mark Mitchell <mark@codesourcery.com> * 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")) |