aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2019-07-29 07:12:04 +0100
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2019-07-31 00:08:49 +0100
commitf69da524f071a754744636dcadfba275d1b00d02 (patch)
tree7592381f4333ad119f4b290a93de5ce250ea1821
parent98f29f8ad971da6e5d700f01b179c7ad87d5e0d4 (diff)
downloadswig-f69da524f071a754744636dcadfba275d1b00d02.tar.gz
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.
-rw-r--r--Source/Modules/main.cxx9
1 files 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;
}
/* -----------------------------------------------------------------------------