bench: Don't return a bool from main

Return `EXIT_SUCCESS` from `main()` on error, not the bool `false`
(introduced in #13112). This is the correct value to return on error,
and also shuts up a clang warning.

Also add a final return for clarity.
This commit is contained in:
Wladimir J. van der Laan 2018-05-30 19:52:58 +02:00
parent 61fcef0f89
commit 493a166948

View file

@ -39,20 +39,19 @@ static void SetupBenchArgs()
gArgs.AddArg("-help", "", false, OptionsCategory::HIDDEN); gArgs.AddArg("-help", "", false, OptionsCategory::HIDDEN);
} }
int int main(int argc, char** argv)
main(int argc, char** argv)
{ {
SetupBenchArgs(); SetupBenchArgs();
std::string error; std::string error;
if (!gArgs.ParseParameters(argc, argv, error)) { if (!gArgs.ParseParameters(argc, argv, error)) {
fprintf(stderr, "Error parsing command line arguments: %s\n", error.c_str()); fprintf(stderr, "Error parsing command line arguments: %s\n", error.c_str());
return false; return EXIT_FAILURE;
} }
if (HelpRequested(gArgs)) { if (HelpRequested(gArgs)) {
std::cout << gArgs.GetHelpMessage(); std::cout << gArgs.GetHelpMessage();
return 0; return EXIT_SUCCESS;
} }
SHA256AutoDetect(); SHA256AutoDetect();
@ -80,4 +79,6 @@ main(int argc, char** argv)
benchmark::BenchRunner::RunAll(*printer, evaluations, scaling_factor, regex_filter, is_list_only); benchmark::BenchRunner::RunAll(*printer, evaluations, scaling_factor, regex_filter, is_list_only);
ECC_Stop(); ECC_Stop();
return EXIT_SUCCESS;
} }