On 05/09/2016 06:14 PM, David Malcolm wrote:
opts-common.c's cmdline_handle_error handles invalid arguments
for options with CL_ERR_ENUM_ARG by building a strings listing the
valid arguments.  By also building a vec of valid arguments, we
can use find_closest_string and provide a hint if we see a close
misspelling.

Successfully bootstrapped&regrtested on x86_64-pc-linux-gnu.

OK for trunk?

gcc/ChangeLog:
        PR driver/69265
        * Makefile.in (GCC_OBJS): Move spellcheck.o to...
        (OBJS-libcommon-target): ...here.
        * opts-common.c: Include spellcheck.h.
        (cmdline_handle_error): Build a vec of valid options and use it
        to suggest provide hints for misspelled arguments.

gcc/testsuite/ChangeLog:
        PR driver/69265
        * gcc.dg/spellcheck-options-11.c: New test case.
OK.
jeff

Reply via email to