You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: c/misra/src/rules/RULE-6-2/SingleBitNamedBitFieldsOfASignedType.ql
+16-12Lines changed: 16 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -13,18 +13,22 @@
13
13
import cpp
14
14
import codingstandards.c.misra
15
15
16
-
/* Check if the DECLARED bit-fields is a single bit, because Rule 6.2 also intends to catch confusion on the programmers' part. Consider:
17
-
18
-
struct S {
19
-
int32_t x: 1;
20
-
}
21
-
22
-
In this case, field x is essentially of 32 bits, but is declared as 1 bit and its type int32_t is signed. Therefore, it indicates confusion by the programmer, which is exactly what this rule intends to find. */
16
+
/*
17
+
* Check if the DECLARED bit-fields is a single bit, because Rule 6.2 also intends to catch confusion on the programmers' part. Consider:
18
+
*
19
+
* struct S {
20
+
* int32_t x: 1;
21
+
* }
22
+
*
23
+
* In this case, field x is essentially of 32 bits, but is declared as 1 bit and its type int32_t is signed. Therefore, it indicates confusion by the programmer, which is exactly what this rule intends to find.
0 commit comments