aboutsummaryrefslogtreecommitdiff
path: root/gold/main.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2008-05-06 18:32:38 +0000
committerIan Lance Taylor <ian@airs.com>2008-05-06 18:32:38 +0000
commitd82a5bcc8556860bf686ba6bc80a07757e334c7a (patch)
treed07d04e045397b3c9e1455b25614da3a055bf2cf /gold/main.cc
parentf1f70eae2856e8a0aae42d74829cedcb02b9801b (diff)
downloadgdb-d82a5bcc8556860bf686ba6bc80a07757e334c7a.zip
gdb-d82a5bcc8556860bf686ba6bc80a07757e334c7a.tar.gz
gdb-d82a5bcc8556860bf686ba6bc80a07757e334c7a.tar.bz2
* options.h (class General_options): Add --fatal-warnings.
* main.cc (main): Implement --fatal-warnings. * errors.h (Errors::warning_count): New function.
Diffstat (limited to 'gold/main.cc')
-rw-r--r--gold/main.cc5
1 files changed, 5 insertions, 0 deletions
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