Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove mardy_assert from OptionParser to prevent initialisation order issues #358

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions src/utils/OptionParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@

#include "OptionParser.h"

#include "utils/mardyn_assert.h"

#include <cstdlib>
#include <algorithm>
#include <complex>
#include <cstdlib>
#include <iostream>
#include <sstream>

#ifdef ENABLE_MPI
Expand Down Expand Up @@ -448,15 +447,13 @@ void OptionParser::print_version() const {
}

void OptionParser::exit() const {
std::ostringstream error_message;
error_message << "OptionParser::exit() called" << std::endl;
MARDYN_EXIT(error_message.str());
std::cerr << "OptionParser::exit() called" << std::endl;
std::exit(1);
}
void OptionParser::error(const std::string& msg) const {
std::cerr << "Optionparser error: " << msg << std::endl;
print_usage(std::cerr);
std::ostringstream error_message;
error_message << prog() << ": " << _("error") << ": " << msg << std::endl;
MARDYN_EXIT(error_message.str());
std::exit(1);
}
////////// } class OptionParser //////////

Expand Down
Loading