Example at 11.1 and 11.2

Moderators: misra-c, david ward

Post Reply
Posts: 15
Joined: Fri May 27, 2005 10:08 am
Company: NMIRI, Gifu-University, TOPPERS project
Location: Japan

Example at 11.1 and 11.2

Post by ogawa.kiyoshi » Wed Apr 29, 2015 10:24 am

In example codes in Rule 11.1 and Rule 11.2

#include <stdlib.h> /* to obtain macro NULL */

in example codes in 11.9

#include <stddef.h>

A freestanding environment needs stdarg.h not sodlib.h.
So I prefer to obtain macro NULL,
#include <stddef.h> // 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.
Dr. OGAWA Kioshi

Posts: 571
Joined: Thu Jan 05, 2006 1:11 pm

Re: Example at 11.1 and 11.2

Post by misra-c » Mon May 11, 2015 8:56 am

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.
Posted by and on behalf of
the MISRA C Working Group

Post Reply

Return to “8.11 Pointer type conversions”