![]() |
![]() |
0507 | ![]() |
||||
![]() | |||||||
| Dataflow - NULL pointers | REFERENCE - ISO:C90-6.2.2.3 Pointers | ||||||
Pointer arithmetic is being performed on a null pointer constant. Internal representation of a null pointer constant is implementation-defined and may not necessarily be bitwise 0. A null pointer constant may be assigned or compared, but any attempt to perform arithmetic operations on it should be viewed as suspicious and non-portable. For example:
/*PRQA S 489,2017,3199,3203,3408 ++*/
#define NULL (void *)0
extern void foo(void)
{
int *p;
p = (int *)(NULL) + 1 ; /* Message 0507 */
}
No MISRA C:2012 Rules applicable to message 0507
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 |