From f69da524f071a754744636dcadfba275d1b00d02 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Mon, 29 Jul 2019 07:12:04 +0100 Subject: [PATCH] Exit code change when using -Werror Exit code is now sum of all errors, not just warnings as errors. I'm can't think why the exit code wasn't like this in the first place. --- Source/Modules/main.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Source/Modules/main.cxx b/Source/Modules/main.cxx index c6bd148e2..294455772 100644 --- a/Source/Modules/main.cxx +++ b/Source/Modules/main.cxx @@ -1376,13 +1376,12 @@ int SWIG_main(int argc, char *argv[], const TargetLanguageModule *tlm) { while (freeze) { } - if ((werror) && (Swig_warn_count())) { - return Swig_warn_count(); - } - delete lang; - return Swig_error_count(); + int error_count = werror ? Swig_warn_count() : 0; + error_count += Swig_error_count(); + + return error_count; } /* -----------------------------------------------------------------------------