![]() |
![]() |
3004 | ![]() |
||||
![]() | |||||||
| Pointers | REFERENCE - ISO:C90-6.2.2.3 Pointers, ISO:C99-6.3.2.3 Pointers | ||||||
ISO:C Standard allows 2 forms of a null pointer constant:
/* PRQA S 1-9999 ++ */
/* PRQA S 3004 -- */
#define NULL (void *)0
void foo (void *);
void f3004 (void)
{
char *p = NULL; /* OK */
p = 0; /* Message 3004 */
if (p == 0) { } /* Message 3004 */
if (0 != p) { } /* Message 3004 */
foo (0); /* Message 3004 */
}
MISRA C:2012 Rules applicable to message 3004:
| Rule-11.9 (Required) | The macro NULL shall be the only permitted form of integer null pointer constant |
![]() | ||
| QA·C Source Code Analyser 8.1
MISRA C:2012 Compliance Module 1.0 © 2012 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index | Contents |