...
Code Block | ||||
---|---|---|---|---|
| ||||
int *p; /* ... */ p++p; |
If the intent was to increment the value referred to by p
, then parentheses can be used to ensure p
is dereferenced and then incremented. (See EXP00-C. Use parentheses for precedence of operation.)
...
Code Block | ||||
---|---|---|---|---|
| ||||
volatile int *p; /* ... */ (void) *(p++); |
Risk Assessment
The presence of code that has no effect can indicate logic errors that may result in unexpected behavior and vulnerabilities.
...