Synopsis: | Pointers shall not be added, multiplied nor divided. |
Language: | C |
Severity Level: | 1 |
Category: | Conversions |
Description: |
Justification A pointer is not an arithmetic type and therefore shall not be misused for arithmetic purposes. Example char *p; char *q; p += q; /* WRONG */ p *=4; /* WRONG */ p++; /* RIGHT */ p += 4; /* RIGHT */ Note Exception: pointer + int |