Commit 794c975287355de48158d9a80ed502d26b20a472

Authored by Daniel Lemire
Committed by GitHub
1 parent 12bc8d78

Exit instead of abort (#233)

Uses std::exit instead of abort to terminate when exceptions are disabled.
Showing 1 changed file with 2 additions and 3 deletions
include/cxxopts.hpp
... ... @@ -480,11 +480,10 @@ namespace cxxopts
480 480 throw T{text};
481 481 #else
482 482 // Otherwise manually instantiate the exception, print what() to stderr,
483   - // and abort
  483 + // and exit
484 484 T exception{text};
485 485 std::cerr << exception.what() << std::endl;
486   - std::cerr << "Aborting (exceptions disabled)..." << std::endl;
487   - std::abort();
  486 + std::exit(EXIT_FAILURE);
488 487 #endif
489 488 }
490 489  
... ...