MISRA Discussion Forums

Full Version: Rule 21.8, assert, and abort
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Does the prohibition on calling the termination functions, specifically "abort", given by Rule 21.8 apply for any process that may arrive at abort? Or only to direct calls to abort requested by user-written code? This is of interest due to the definition of assert which indicates that it calls the "abort" function if the assert fails. Does 21.8, then, prohibit the use of assert?
It is implicit that expansion of the assert() macro that includes a call to abort() is a violation to Rule 21.8.

The prohibition on calling the termination functions, including "abort", given by Rule 21.8 applies for any process that may arrive at such functions.