[previous] 3004 [next] This integral constant expression is being interpreted as a NULL pointer constant.
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: The latter is preferable because it is of pointer type.

For example:


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

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