On Mon, Jan 29, 2018 at 02:54:15PM -0600, Peter Bergner wrote:
> On 1/29/18 2:33 PM, Peter Bergner wrote:
> > The current version of that code looks like the following, which I should
> > copy instead.  Unless you have a different suggestion?
> > 
> >       char *s;
> > 
> >       if (e->unknown_error)
> >         error_at (loc, e->unknown_error, arg);
> >       else
> >         error_at (loc, "unrecognized argument in option %qs", opt);
> > 
> >       auto_vec <const char *> candidates;
> >       for (i = 0; e->values[i].arg != NULL; i++)
> >         {
> >           if (!enum_arg_ok_for_language (&e->values[i], lang_mask))
> >             continue;
> >           candidates.safe_push (e->values[i].arg);
> >         }
> >       const char *hint = candidates_list_and_hint (arg, s, candidates);
> >       if (hint)
> >         inform (loc, "valid arguments to %qs are: %s; did you mean %qs?",
> >                 option->opt_text, s, hint);
> >       else
> >         inform (loc, "valid arguments to %qs are: %s", option->opt_text, s);
> >       XDELETEVEC (s);
> 
> Actually, all the "macic" of this code happens in candidates_list_and_hint()
> and that looks much like the GCC 5 code I showed, plus a call to
> find_closest_string() which we don't want, so I think just sticking with
> the original code in the last patch is probably best.

Why don't you want that?  It let's the compiler say "hey silly human who
can hardly type his own name correctly(*), you meant -mcpu-power8 where
you said -mcpu=poewr8".  It's a quite useful feature.  Also amusing in
the cases where it fails spectacularly :-)

Plus, removing support for that would be a regression.

(*) not talking about myself here, oh no.


Segher

Reply via email to