[previous] 2810 [next] Constant: Dereference of NULL pointer.
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 behavior.

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 */

}

See also:

QA·C Source Code Analyser 8.1.2
© 2013 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index Contents