Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jarro2783/cxxopts.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Lemire <lemire@gmail.com>2020-05-29 01:30:35 +0300
committerGitHub <noreply@github.com>2020-05-29 01:30:35 +0300
commit794c975287355de48158d9a80ed502d26b20a472 (patch)
tree52906fede7826ceea1167427774776e22965edf5
parent12bc8d78e778b65bec357760bbe26b734abdf0e7 (diff)
Exit instead of abort (#233)
Uses std::exit instead of abort to terminate when exceptions are disabled.
-rw-r--r--include/cxxopts.hpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/cxxopts.hpp b/include/cxxopts.hpp
index 3dd5f52..e47cb81 100644
--- a/include/cxxopts.hpp
+++ b/include/cxxopts.hpp
@@ -480,11 +480,10 @@ namespace cxxopts
throw T{text};
#else
// Otherwise manually instantiate the exception, print what() to stderr,
- // and abort
+ // and exit
T exception{text};
std::cerr << exception.what() << std::endl;
- std::cerr << "Aborting (exceptions disabled)..." << std::endl;
- std::abort();
+ std::exit(EXIT_FAILURE);
#endif
}