[previous] 2105 [next] Integral promotion : signed short promoted to signed int.
Arithmetic type - Integral promotion REFERENCE - ISO:C90-6.2.1.1 Characters and Integers

An operand of type signed short is being converted to type signed int under the rules of integral promotion.

This type of conversion will occur whenever an expression of type signed short is used as an operand of the following operators:

Unary + - ~
Multiplicative * / %
Additive + -
Bitwise Shift << >>
Relational < > <= >=
Equality == !=
Bitwise & | ^
Conditional ? : (2nd and 3rd operands)

For example:


/*PRQA S 3408,3447,3602,4130 ++*/

extern signed short sa;
extern signed short sb;
extern signed short sr;
extern signed int  si;

extern void foo(void)
{
    sr = sa + sb;                             /* Message 2105 */
    si = ~sr;                                 /* Message 2105 */
}


No MISRA-C:2004 Rules applicable to message 2105


QA·C Source Code Analyser 8.1
MISRA-C:2004 Compliance Module 3.2
© 2012 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA-C:2004 Rule Index Contents