![]() |
![]() |
2124 | ![]() |
||||
![]() | |||||||
| Arithmetic type - Integral promotion | REFERENCE - ISO:C90-6.2.1.1 Characters and Integers | ||||||
A bit-field of signed type is being converted to type signed int under the rules of integral promotion. This type of conversion will occur whenever a signed bit-field is used as an operand to one of the following operators:
| Unary | + - ~ |
| Multiplicative | * / % |
| Additive | + - |
| Bitwise Shift | << >> |
| Relational | < > <= >= |
| Equality | == != |
| Bitwise | & | ^ |
| Conditional | ? : (2nd and 3rd operands) |
/*PRQA S 2017,3131,3408,3447,3602,3621 ++*/
struct ST
{
signed int sib3:3;
signed int sib5:5;
};
extern struct ST stx;
extern signed char sr;
extern void foo(void)
{
sr = -stx.sib3; /* Message 2124 */
}
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |