...
Because assert()
calls abort()
, cleanup functions registered with atexit()
are not called. If the intention of the programmer is properly cleanup in the case of a failed assertion, a signal handler that calls exit()
should be installed to handle SIGABRT
.
See \[[ERR04-A. Choose an appropriate termination strategy]\] for more information on program termination strategies and \[[MSC11-A. Incorporate diagnostic tests using assertions]\] for more information on using the {{ Wiki Markup assert()
}} macro.
Non-Compliant Code Example
...