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

Rule:  6.3.bChecked automatically with code checker

Synopsis:Unsafe implicit conversions of literals shall be avoided.
Language:C
Severity Level:8
Category:Conversions


Description:

Justification

Implicit conversions may be complex or unclearly defined. Unsafe implicit conversions should be avoided because values can be truncated or sign can be lost. When unsafe conversions are needed they shall be specified explicitly.

Example

void foo(int si)
{
   if (si < 0x8000U) /* int converted to unsigned for comparison */
   ...
}