std::abort (3) - Linux Manuals
std::abort: std::abort
NAME
Synopsis
Defined in header <cstdlib>
void abort(); (until C++11)
[[noreturn]] void abort() noexcept; (since C++11)
Causes abnormal program termination unless SIGABRT is being caught by a signal handler passed to std::signal and the handler does not return.
Destructors of variables with automatic,
thread local
(since C++11) and static storage_durations are not called. Functions registered with std::atexit()
and std::at_quick_exit
(since C++11) are also not called. Whether open resources such as files are closed is implementation defined. An implementation defined status is returned to the host environment that indicates unsuccessful execution.
Parameters
(none)
Return value
(none)
Exceptions
(none)
Notes
POSIX specifies that the abort() function overrides blocking or ignoring the SIGABRT signal.
Example
// Run this code
Output:
See also
exit (function)
atexit (function)
quick_exit causes quick program termination without completely cleaning up
(C++11)
at_quick_exit registers a function to be called on quick_exit invocation
(C++11)
signal (function)