Skip to content

Commit f96818d

Browse files
Use macros of exit codes in JBMC
1 parent 8454539 commit f96818d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Diff for: jbmc/src/jbmc/jbmc_parse_options.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ int jbmc_parse_optionst::doit()
417417
if(cmdline.isset("version"))
418418
{
419419
std::cout << CBMC_VERSION << '\n';
420-
return 0; // should contemplate EX_OK from sysexits.h
420+
return CPROVER_EXIT_SUCCESS;
421421
}
422422

423423
messaget::eval_verbosity(
@@ -469,7 +469,7 @@ int jbmc_parse_optionst::doit()
469469
if(cmdline.args.size()!=1)
470470
{
471471
log.error() << "Please give exactly one source file" << messaget::eom;
472-
return 6;
472+
return CPROVER_EXIT_INCORRECT_TASK;
473473
}
474474

475475
std::string filename=cmdline.args[0];
@@ -484,7 +484,7 @@ int jbmc_parse_optionst::doit()
484484
{
485485
log.error() << "failed to open input file `" << filename << "'"
486486
<< messaget::eom;
487-
return 6;
487+
return CPROVER_EXIT_INCORRECT_TASK;
488488
}
489489

490490
std::unique_ptr<languaget> language=
@@ -494,7 +494,7 @@ int jbmc_parse_optionst::doit()
494494
{
495495
log.error() << "failed to figure out type of file `" << filename << "'"
496496
<< messaget::eom;
497-
return 6;
497+
return CPROVER_EXIT_INCORRECT_TASK;
498498
}
499499

500500
language->set_language_options(options);
@@ -505,11 +505,11 @@ int jbmc_parse_optionst::doit()
505505
if(language->parse(infile, filename))
506506
{
507507
log.error() << "PARSING ERROR" << messaget::eom;
508-
return 6;
508+
return CPROVER_EXIT_PARSE_ERROR;
509509
}
510510

511511
language->show_parse(std::cout);
512-
return 0;
512+
return CPROVER_EXIT_SUCCESS;
513513
}
514514

515515
object_factory_params.set(options);
@@ -520,7 +520,7 @@ int jbmc_parse_optionst::doit()
520520
if(cmdline.args.empty())
521521
{
522522
log.error() << "Please provide a program to verify" << messaget::eom;
523-
return 6;
523+
return CPROVER_EXIT_INCORRECT_TASK;
524524
}
525525

526526
if(cmdline.args.size() != 1)
@@ -531,7 +531,7 @@ int jbmc_parse_optionst::doit()
531531
" or '--lazy-methods-extra-entry-point "
532532
"somepackage.SomeClass.method' along with '--classpath'"
533533
<< messaget::eom;
534-
return 6;
534+
return CPROVER_EXIT_INCORRECT_TASK;
535535
}
536536

537537
std::unique_ptr<abstract_goto_modelt> goto_model_ptr;
@@ -689,7 +689,7 @@ int jbmc_parse_optionst::get_goto_program(
689689
goto_model_ptr = lazy_goto_modelt::process_whole_model_and_freeze(
690690
std::move(lazy_goto_model));
691691
if(goto_model_ptr == nullptr)
692-
return 6;
692+
return CPROVER_EXIT_INTERNAL_ERROR;
693693

694694
goto_modelt &goto_model = dynamic_cast<goto_modelt &>(*goto_model_ptr);
695695

@@ -712,7 +712,7 @@ int jbmc_parse_optionst::get_goto_program(
712712
if(!lazy_goto_model.symbol_table.has_symbol(goto_functionst::entry_point()))
713713
{
714714
log.error() << "the program has no entry point" << messaget::eom;
715-
return 6;
715+
return CPROVER_EXIT_INCORRECT_TASK;
716716
}
717717

718718
if(cmdline.isset("validate-goto-model"))

0 commit comments

Comments
 (0)