![]() |
![]() |
2941 | ![]() |
||||
![]() | |||||||
| Conversion to signed | |||||||
A negative value is being implicitly converted to a signed integer type, but examination of the context indicates that the value is always such that it is only representable in this particular type if two's-complement representation is assumed. In practice, two's complement representation is almost universal in modern computers, but other binary representations do exist. Message 2941 will be generated when
/*PRQA S 281,1278,2017,2983,2986,3120,3199,3203,3227,3408,3602 ++*/
/***************************************************/
/* OPTIONS: -s int=16 */
/***************************************************/
void foo(signed long slr)
{
signed int sir;
if (slr == -32768L)
{
sir = slr; /* 2941 3782 */
}
}
No MISRA C:2012 Rules applicable to message 2941
See also:
![]() | ||
| QA·C Source Code Analyser 8.1
MISRA C:2012 Compliance Module 1.0 © 2012 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index | Contents |