MISRA Discussion Forums
A question for Rule21.8 - Printable Version

+- MISRA Discussion Forums (https://forum.misra.org.uk)
+-- Forum: MISRA C (https://forum.misra.org.uk/forumdisplay.php?fid=4)
+--- Forum: MISRA C:2012 and MISRA C:2023 guidelines (https://forum.misra.org.uk/forumdisplay.php?fid=21)
+---- Forum: 8.21 Standard libraries (https://forum.misra.org.uk/forumdisplay.php?fid=176)
+---- Thread: A question for Rule21.8 (/showthread.php?tid=1076)



A question for Rule21.8 - tsukukazu - 14-07-2014

Hello.

I have a question about rule 21.8.

_Exit Function that were added in C99 also has implementation-defined behavior.

Is this not included?

Best regards,
Kazuhiro Tsukushiro


Re: A question for Rule21.8 - misra-c - 11-08-2014

It was a conscious decision not to include _Exit in this rule. _Exit() differs from exit() in that no atexit-registered handlers are called prior to program termination. This means that the undefined behaviour that can occur with exit() isn't possible with _Exit().

The implementation-defined behaviour remains a possibility (e.g. the status code returned to the environment, whether temporary files are deleted or not, whether streams are flushed and/or closed) but this was considered not to be a strong enough reason to ban _Exit().


RE: A question for Rule21.8 - misra-c - 02-07-2024

Subsequent to the previous answer, MISRA C:2012 Amendment 3 added _Exit() to Rule 21.8