Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In this example, p is incremented and then dereferenced, . However, *p has no effect.

Code Block
bgColor#FFCCCC
int *p;
/* ... */
*p++;

...

Code Block
bgColor#ccccff
int *p;
/* ... */
(*p)++

Compliant Solution (memory mapped devices)

Another possibility is that p is being using to reference a memory-mapped device. In this case, the variable p should be declared as volatile.

Code Block
bgColor#ccccff

volatile int *p;
/* ... */
(void) *p++;

Risk Assessment

The presence of code that has no effect could indicate logic errors that may result in unexpected behavior and vulnerabilities.

...