![]() |
![]() |
0502 | ![]() |
||||
![]() | |||||||
| Arithmetic type - Operations | |||||||
A right shift operation is being performed on an operand whose underlying type is signed. If the value is negative, the result will be implementation-defined. A right shift operation on signed data may be performed in two different ways - depending on the compiler.
/*PRQA S 2017,2100,3120,3198,3408,3447 ++*/
extern int sia;
extern unsigned char uca;
extern void foo(void)
{
sia = sia >> 3; /* Message 0502 */
sia = uca >> 3; /* No message */
sia = sia << 3; /* Message 4131 */
sia = uca << 3; /* No message */
}
See also:
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |