![]() |
![]() |
2921 | ![]() |
||||
![]() | |||||||
| Shift operations | |||||||
An expression of unsigned type is the subject of a left shift operation and examination of the context indicates that high order bits will always be lost. Is this intended ? For example:
/*PRQA S 2017,2983,2986,3120,3199,3371,3408 ++*/
/*******************************/
/* OPTIONS: -s int=16 */
/*******************************/
void foo(unsigned int un)
{
if (un > 0x1000U)
{
un = un << 4; /* 2921 */
}
}
No MISRA C:2012 Rules applicable to message 2921
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 |