diff options
| author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-01-03 20:56:22 +0000 |
|---|---|---|
| committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-01-03 20:56:22 +0000 |
| commit | 76a6e674dcc99316839e64af6262dee504fd1b54 (patch) | |
| tree | f0e8c65e787de4d8629a814f63958c000e5b164f /gcc/c-common.c | |
| parent | 72f3368f4dd49c93db258b32a2198b904a24e60d (diff) | |
| download | ppe42-gcc-76a6e674dcc99316839e64af6262dee504fd1b54.tar.gz ppe42-gcc-76a6e674dcc99316839e64af6262dee504fd1b54.zip | |
* c-common.c (c_common_lang_init): New function. Warn if format
warning options which only have effects when used with -Wformat
are used without -Wformat.
* c-common.h (c_common_lang_init): Declare.
* c-lang.c (lang_init): Call c_common_lang_init.
* objc/objc-act.c (lang_init): Call c_common_lang_init.
cp:
* lex.c (lang_init): Call c_common_lang_init.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38672 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-common.c')
| -rw-r--r-- | gcc/c-common.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index 27dc0873db6..71234b75bcb 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -6555,3 +6555,26 @@ boolean_increment (code, arg) TREE_SIDE_EFFECTS (val) = 1; return val; } + + +/* Do the parts of lang_init common to C and C++. */ +void +c_common_lang_init () +{ + /* If still "unspecified", make it match -fbounded-pointers. */ + if (flag_bounds_check < 0) + flag_bounds_check = flag_bounded_pointers; + + /* Special format checking options don't work without -Wformat; warn if + they are used. */ + if (warn_format_y2k && !warn_format) + warning ("-Wformat-y2k ignored without -Wformat"); + if (warn_format_extra_args && !warn_format) + warning ("-Wformat-extra-args ignored without -Wformat"); + if (warn_format_nonliteral && !warn_format) + warning ("-Wformat-nonliteral ignored without -Wformat"); + if (warn_format_security && !warn_format) + warning ("-Wformat-security ignored without -Wformat"); + if (warn_missing_format_attribute && !warn_format) + warning ("-Wmissing-format-attribute ignored without -Wformat"); +} |

