From d82a5bcc8556860bf686ba6bc80a07757e334c7a Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 6 May 2008 18:32:38 +0000 Subject: * options.h (class General_options): Add --fatal-warnings. * main.cc (main): Implement --fatal-warnings. * errors.h (Errors::warning_count): New function. --- gold/main.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gold/main.cc') diff --git a/gold/main.cc b/gold/main.cc index 9b6ded0..c785da2 100644 --- a/gold/main.cc +++ b/gold/main.cc @@ -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 -- cgit v1.1