![]() |
![]() |
2810 | ![]() |
||||
![]() | |||||||
| NULL pointers | |||||||
An attempt has been made to dereference a null pointer constant. This is not an operation which the C language allows and it will result in undefined behaviour. For example:
/*PRQA S 503,2017,2982,2983,2984,2986,3198,3199,3203,3408 ++*/
extern void foo(void)
{
int r;
r = *(int *)0; /* 2810 */
r = *(int *)(void *)0; /* 2810 */
}
MISRA C:2012 Rules applicable to message 2810:
| Rule-1.3 (Required) | There shall be no occurrence of undefined or critical unspecified behaviour |
See also:
![]() | ||
| 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 |