Commit a4e747a2 authored by jsm28's avatar jsm28
Browse files

* gcc.c (driver_unknown_option_callback): Only permit and save

	unknown -Wno- options.
	(driver_wrong_lang_callback): Save options directly instead of via
	driver_unknown_option_callback.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@171307 138bc75d-0d04-0410-961f-82ee72b054a4
parent e4ffbd30
2011-03-22 Joseph Myers <joseph@codesourcery.com>
* gcc.c (driver_unknown_option_callback): Only permit and save
unknown -Wno- options.
(driver_wrong_lang_callback): Save options directly instead of via
driver_unknown_option_callback.
2011-03-22 Eric Botcazou <ebotcazou@adacore.com> 2011-03-22 Eric Botcazou <ebotcazou@adacore.com>
* combine.c (simplify_set): Try harder to find the best CC mode when * combine.c (simplify_set): Try harder to find the best CC mode when
......
...@@ -3080,16 +3080,24 @@ save_switch (const char *opt, size_t n_args, const char *const *args, ...@@ -3080,16 +3080,24 @@ save_switch (const char *opt, size_t n_args, const char *const *args,
} }
/* Handle an option DECODED that is unknown to the option-processing /* Handle an option DECODED that is unknown to the option-processing
machinery, but may be known to specs. */ machinery. */
static bool static bool
driver_unknown_option_callback (const struct cl_decoded_option *decoded) driver_unknown_option_callback (const struct cl_decoded_option *decoded)
{ {
save_switch (decoded->canonical_option[0], const char *opt = decoded->arg;
decoded->canonical_option_num_elements - 1, if (opt[1] == 'W' && opt[2] == 'n' && opt[3] == 'o' && opt[4] == '-'
&decoded->canonical_option[1], false); && !(decoded->errors & CL_ERR_NEGATIVE))
{
return false; /* Leave unknown -Wno-* options for the compiler proper, to be
diagnosed only if there are warnings. */
save_switch (decoded->canonical_option[0],
decoded->canonical_option_num_elements - 1,
&decoded->canonical_option[1], false);
return false;
}
else
return true;
} }
/* Handle an option DECODED that is not marked as CL_DRIVER. /* Handle an option DECODED that is not marked as CL_DRIVER.
...@@ -3110,7 +3118,9 @@ driver_wrong_lang_callback (const struct cl_decoded_option *decoded, ...@@ -3110,7 +3118,9 @@ driver_wrong_lang_callback (const struct cl_decoded_option *decoded,
error ("unrecognized command line option %qs", error ("unrecognized command line option %qs",
decoded->orig_option_with_args_text); decoded->orig_option_with_args_text);
else else
driver_unknown_option_callback (decoded); save_switch (decoded->canonical_option[0],
decoded->canonical_option_num_elements - 1,
&decoded->canonical_option[1], false);
} }
/* Note that an option (index OPT_INDEX, argument ARG, value VALUE) /* Note that an option (index OPT_INDEX, argument ARG, value VALUE)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment