diff options
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 c6b9418..004da73 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, |