https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69265

--- Comment #7 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Author: dmalcolm
Date: Thu May 19 00:52:08 2016
New Revision: 236439

URL: https://gcc.gnu.org/viewcvs?rev=236439&root=gcc&view=rev
Log:
PR driver/69265: add hint for options with misspelled arguments

opts-common.c's cmdline_handle_error handles invalid arguments
for options with CL_ERR_ENUM_ARG by building a string 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.

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.

Added:
    trunk/gcc/testsuite/gcc.dg/spellcheck-options-11.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/Makefile.in
    trunk/gcc/opts-common.c
    trunk/gcc/testsuite/ChangeLog

Reply via email to