diff options
author | Joseph Myers <jsm28@cam.ac.uk> | 2000-12-07 07:56:44 +0000 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2000-12-07 07:56:44 +0000 |
commit | c907e684899b80f605c6f318ac47d825cefd5e04 (patch) | |
tree | b5375290ebf0a5a6f82ddbfa46e51e6bde6dbb84 /gcc/c-decl.c | |
parent | 1c248308f49a5410b9e69330a924f264707625d7 (diff) | |
download | gcc-c907e684899b80f605c6f318ac47d825cefd5e04.zip gcc-c907e684899b80f605c6f318ac47d825cefd5e04.tar.gz gcc-c907e684899b80f605c6f318ac47d825cefd5e04.tar.bz2 |
c-common.c (warn_format_security): New variable.
* c-common.c (warn_format_security): New variable.
(check_format_info): Warn about non-literal formats with no format
arguments if either -Wformat-nonliteral or -Wformat-security is
specified.
(set_Wformat): Set warn_format_security for settings other than 1.
* c-common.h (warn_format_security): Declare.
* c-decl.c (c_decode_option): Decode -Wformat-security and
-Wno-format-security.
* invoke.texi: Document -Wformat-security.
* toplev.c (documented_lang_options): Include -Wformat-security
and -Wno-format-security.
cp:
* decl2.c (lang_decode_option): Handle -Wformat-security.
testsuite:
* format-sec-1.c: New test.
From-SVN: r38106
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 4f1142a..4776cd6 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -719,6 +719,10 @@ c_decode_option (argc, argv) warn_format_nonliteral = 1; else if (!strcmp (p, "-Wno-format-nonliteral")) warn_format_nonliteral = 0; + else if (!strcmp (p, "-Wformat-security")) + warn_format_security = 1; + else if (!strcmp (p, "-Wno-format-security")) + warn_format_security = 0; else if (!strcmp (p, "-Wchar-subscripts")) warn_char_subscripts = 1; else if (!strcmp (p, "-Wno-char-subscripts")) |