X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/ba7560e26bfa2f5a340545830d46e0437fcb701a..ab8e7e1a8220a7ad99c4d47711c1123b7677bd81:/src/getargs.c diff --git a/src/getargs.c b/src/getargs.c index 94d24329..563cc129 100644 --- a/src/getargs.c +++ b/src/getargs.c @@ -75,9 +75,9 @@ extern char *program_name; /** Decode an option's set of keys. * * \param option option being decoded. - * \paran keys array of valid subarguments. + * \param keys array of valid subarguments. * \param values array of corresponding (int) values. - * \param flag the flags to update + * \param flags the flags to update * \param args colon separated list of effective subarguments to decode. * If 0, then activate all the flags. * @@ -98,7 +98,7 @@ flags_argmatch (const char *option, *flags = 0; else *flags |= value; - args = strtok (NULL, ","); + args = strtok (NULL, ","); } } else @@ -108,7 +108,7 @@ flags_argmatch (const char *option, /** Decode a set of sub arguments. * * \param FlagName the flag familly to update. - * \param args the effective sub arguments to decode. + * \param Args the effective sub arguments to decode. * * \arg FlagName_args the list of keys. * \arg FlagName_types the list of values. @@ -203,19 +203,21 @@ static const char * const warnings_args[] = { /* In a series of synonyms, present the most meaningful first, so that argmatch_valid be more readable. */ - "none - no warnings", - "error - warnings are errors", - "yacc - incompatibilities with POSIX YACC", - "all - all of the above", + "none - no warnings", + "midrule-values - unset or unused midrule values", + "yacc - incompatibilities with POSIX YACC", + "all - all of the above", + "error - warnings are errors", 0 }; static const int warnings_types[] = { warnings_none, - warnings_error, + warnings_midrule_values, warnings_yacc, - warnings_all + warnings_all, + warnings_error }; ARGMATCH_VERIFY (warnings_args, warnings_types); @@ -406,7 +408,7 @@ getargs (int argc, char *argv[]) /* Here, the -g and --graph=FILE options are differentiated. */ graph_flag = true; if (optarg) - spec_graph_file = AS_FILE_NAME (optarg); + spec_graph_file = xstrdup (AS_FILE_NAME (optarg)); break; case 'h': @@ -424,7 +426,7 @@ getargs (int argc, char *argv[]) /* Here, the -d and --defines options are differentiated. */ defines_flag = true; if (optarg) - spec_defines_file = AS_FILE_NAME (optarg); + spec_defines_file = xstrdup (AS_FILE_NAME (optarg)); break; case 'k': @@ -472,7 +474,10 @@ getargs (int argc, char *argv[]) break; case 'W': - FLAGS_ARGMATCH (warnings, optarg); + if (optarg) + FLAGS_ARGMATCH (warnings, optarg); + else + warnings_flag |= warnings_all; break; case LOCATIONS_OPTION: