MISRA Discussion Forums

Full Version: Example at 11.1 and 11.2
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In example codes in Rule 11.1 and Rule 11.2

#include /* to obtain macro NULL */

in example codes in 11.9

#include

A freestanding environment needs stdarg.h not sodlib.h.
So I prefer to obtain macro NULL,
#include // to obtain macro NULL

Is it reasonable?

ps. in 11.9
/* Could also be stdio.h, stdlib.h and others */

I prefer
/* A free standing environment needs stddef.h */
/* Could also be stdio.h, stdlib.h and others in host environments */

Best Regards.
Thank you for your point. We will modify the examples to use stddef.h in a future update.

Note: A more correct statement in the original question would be "A freestanding environment needs stddef.h not stdlib.h.", since stdarg.h does not contain a definition of NULL.