aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorMartin Liska <marxin@gcc.gnu.org>2016-12-21 15:05:10 +0000
committerMartin Liska <marxin@gcc.gnu.org>2016-12-21 15:05:10 +0000
commitb0a3329db0bbb9394131f28ebb03c9f33060771a (patch)
treeb5b0f36bb4900b2334d13addaa0928e1bfa055be /gcc/gcc.c
parent592e4d9459282554601e983a6423b258244864b3 (diff)
downloadgcc-b0a3329db0bbb9394131f28ebb03c9f33060771a.zip
gcc-b0a3329db0bbb9394131f28ebb03c9f33060771a.tar.gz
gcc-b0a3329db0bbb9394131f28ebb03c9f33060771a.tar.bz2
Do not suggest -fsanitize=all (PR driver/78863).
PR driver/78863 * gcc.c (driver::build_option_suggestions): Do not add -fsanitize=all as a suggestion candidate. PR driver/78863 * gcc.dg/spellcheck-options-13.c: New test. From-SVN: r243857
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index f78acd6..6908948 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -7733,6 +7733,17 @@ driver::build_option_suggestions (void)
{
for (int j = 0; sanitizer_opts[j].name != NULL; ++j)
{
+ struct cl_option optb;
+ /* -fsanitize=all is not valid, only -fno-sanitize=all.
+ So don't register the positive misspelling candidates
+ for it. */
+ if (sanitizer_opts[j].flag == ~0U && i == OPT_fsanitize_)
+ {
+ optb = *option;
+ optb.opt_text = opt_text = "-fno-sanitize=";
+ optb.cl_reject_negative = true;
+ option = &optb;
+ }
/* Get one arg at a time e.g. "-fsanitize=address". */
char *with_arg = concat (opt_text,
sanitizer_opts[j].name,