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

Rule:  6.5.16.bChecked automatically with code checker

Synopsis:Do not discard const qualifiers in pointer assignments.
Language:C
Severity Level:6
Category:Expressions


Description:

Justification

Discarding const qualifiers in pointer assignments is allowed in C but not in C++. In order to keep code being portable to C++, it is not recommended to perform such assignments.

Example

const int* p;
int* q;
q = p; /* WRONG */

const int* p;
const int* q;
q = p; /* RIGHT */