* options.h (class General_options): Add --fatal-warnings.

* main.cc (main): Implement --fatal-warnings.
	* errors.h (Errors::warning_count): New function.
This commit is contained in:
Ian Lance Taylor 2008-05-06 18:32:38 +00:00
parent f1f70eae28
commit d82a5bcc85
4 changed files with 18 additions and 0 deletions

View file

@ -220,6 +220,11 @@ main(int argc, char** argv)
layout.print_stats();
}
if (parameters->options().fatal_warnings()
&& errors.warning_count() > 0
&& errors.error_count() == 0)
gold_error("treating warnings as errors");
// If the user used --noinhibit-exec, we force the exit status to be
// successful. This is compatible with GNU ld.
gold_exit(errors.error_count() == 0