diff options
author | Martin Liska <mliska@suse.cz> | 2018-06-12 16:21:10 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2018-06-12 14:21:10 +0000 |
commit | 3713f2e213602fdc5119c3b9ece371330ceeac30 (patch) | |
tree | 592c42292c6ead5672c1bc6944f10d30928368ca /gcc/opts-common.c | |
parent | 09d69286160a4027dc5c8fc27bff0113f698b25f (diff) |
Come up with Deprecated option flag.
2018-06-12 Martin Liska <mliska@suse.cz>
* doc/options.texi: Document Deprecated option flag.
2018-06-12 Martin Liska <mliska@suse.cz>
* config/i386/i386.opt: Make MPX-related options as Deprecated.
* opt-functions.awk: Handle Deprecated flag.
* opts-common.c (decode_cmdline_option): Handle cl_deprecated
and report error.
(read_cmdline_option): Report warning for a deprecated option.
* opts.h (struct cl_option): Add new field cl_deprecated.
(CL_ERR_DEPRECATED): New.
2018-06-12 Martin Liska <mliska@suse.cz>
* c.opt: Make MPX-related options as Deprecated.
2018-06-12 Martin Liska <mliska@suse.cz>
* g++.dg/opt/mpx.C: New test.
* gcc.target/i386/mpx.c: New test.
From-SVN: r261497
Diffstat (limited to 'gcc/opts-common.c')
-rw-r--r-- | gcc/opts-common.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/opts-common.c b/gcc/opts-common.c index c6b94188b40..004da73e614 100644 --- a/gcc/opts-common.c +++ b/gcc/opts-common.c @@ -667,6 +667,10 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask, if (!option_ok_for_language (option, lang_mask)) errors |= CL_ERR_WRONG_LANG; + /* Mark all deprecated options. */ + if (option->cl_deprecated) + errors |= CL_ERR_DEPRECATED; + /* Convert the argument to lowercase if appropriate. */ if (arg && option->cl_tolower) { @@ -1250,6 +1254,12 @@ read_cmdline_option (struct gcc_options *opts, return; } + if (decoded->errors & CL_ERR_DEPRECATED) + { + warning_at (loc, 0, "deprecated command line option %qs", opt); + return; + } + gcc_assert (!decoded->errors); if (!handle_option (opts, opts_set, decoded, lang_mask, DK_UNSPECIFIED, |