TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
ASML C Coding Standard
Search

Rule:  6.3.2.2.dChecked automatically with code checker

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