Skip to content
Snippets Groups Projects
Commit 1eac90da authored by Sam Yates's avatar Sam Yates
Browse files

Use cerr in preference to stderr for assertion message.

* Finds an actual (possibly) reasonable use for std::endl.
parent e17c1ec5
No related branches found
No related tags found
No related merge requests found
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include "util/debug.hpp"
bool nest::mc::util::failed_assertion(const char *assertion, const char *file,
int line, const char *func)
{
std::fprintf(stderr, "%s:%d %s: Assertion `%s' failed.\n", file, line, func, assertion);
// Explicit flush, as we can't assume default buffering semantics on stderr/cerr,
// and abort() mignt not flush streams.
std::cerr << file << ':' << line << " " << func
<< ": Assertion `" << assertion << "' failed." << std::endl;
std::abort();
return false;
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment