![]() |
![]() |
2920 | ![]() |
||||
![]() | |||||||
| Shift operations | |||||||
A left-shift operation is being performed on a constant expression of unsigned integer type and this will result in the loss of some non-zero high-order bits. Is this intended ? For example:
/*PRQA S 1279,2017,2022,2982,2984,3120,3198,3211,3301,3408 ++*/
unsigned long ula;
extern void foo(void)
{
ula = 0x00F00000UL << 8; /* */
ula = 0x00F00000UL << 9; /* 2920 */
ula = 0x0F000000UL << 4; /* */
ula = 0x0F000000UL << 5; /* 2920 */
ula = 0xF0000000UL << 0; /* */
ula = 0xF0000000UL << 1; /* 2920 */
}
No MISRA-C:2004 Rules applicable to message 2920
See also:
![]() | ||
| 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 |