Consistently process -W(no-)error after all other warning options. automake and aclocal were processing ‘-W(no-)error’ whenever it appeared on the command line, which means that ‘-Werror,something-strange’ would issue a hard error, but ‘-Wsomething-strange,error’ would only issue a warning. It is not desirable for warnings about unknown warning categories ever to be treated as a hard error; that leads to problems for driver scripts like autoreconf, which would like to pass whatever -W options it got on its own command line down to all the tools and not worry about which tools understand which warning categories. Also, this sort of order dependence is confusing for humans. Change parse_warnings to take just one option, the _complete_ list of warning categories seen on the command line, and to process -Werror / -Wno-error after processing all other warnings options. Thus, unknown warnings categories will always just be a plain warning. This does mean aclocal has to stop using parse_warnings as a Getopt::Long callback, but that’s not a big deal. Similarly, change parse_WARNINGS to record whether ‘error’ appeared in the environment variable, but not activate warnings-are-errors mode itself. parse_warnings picks up the record and honors it, unless it’s overridden by the command line. * lib/Automake/ChannelDefs.pm ($werror): New package global (not exported). (parse_WARNINGS): Do not call switch_warning for ‘error’ / ‘no-error’; just toggle the value of $werror. (parse_warnings): Do not call switch_warning immediately for ‘error’ / ‘no-error’; toggle $werror instead. Call switch_warning ‘error’ at the very end if $werror is true. Remove unused $OPTION argument. * bin/automake.in: parse_warnings now takes only one argument. * bin/aclocal.in: Call parse_warnings after parse_options instead of using it as a parse_options callback.