![]() |
![]() |
2942 | ![]() |
||||
![]() | |||||||
| 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 sometimes 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 2942 will be generated when
/*PRQA S 282,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; /* 2942 3782 */
}
See also:
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |