File tree 2 files changed +19
-15
lines changed
Filter options
2 files changed +19
-15
lines changed
Original file line number Diff line number Diff line change @@ -3,11 +3,13 @@ typedef unsigned int UINT16;
3
3
enum Color { R , G , B };
4
4
5
5
struct SampleStruct {
6
- int x1 : 2 ; // NON_COMPLIANT - not explicitly signed or unsigned
7
- unsigned int x2 : 2 ; // COMPILANT - explicitly unsigned (example in the doc)
6
+ int x1 : 2 ; // NON_COMPLIANT - not explicitly signed or unsigned
7
+ unsigned int x2 : 2 ; // COMPILANT - explicitly unsigned
8
8
signed int x3 : 2 ; // COMPILANT - explicitly signed
9
- UINT16 x4 : 2 ; // COMPLIANT - type alias resolves to a compliant type
10
- signed long x5 : 2 ; // NON_COMPLIANT - cannot declare bit field for long, even if it's signed
11
- signed char x6 : 2 ; // NON_COMPILANT - cannot declare bit field for char, even if it's signed
9
+ UINT16 x4 : 2 ; // COMPLIANT - type alias resolves to a compliant type
10
+ signed long x5 : 2 ; // NON_COMPLIANT - cannot declare bit field for long, even
11
+ // if it's signed
12
+ signed char x6 : 2 ; // NON_COMPILANT - cannot declare bit field for char, even
13
+ // if it's signed
12
14
enum Color x7 : 3 ; // NON_COMPILANT - cannot declare bit field for enum
13
- } sample_struct ;
15
+ } sample_struct ;
Original file line number Diff line number Diff line change 1
1
#include <stdint.h>
2
2
3
3
struct SampleStruct {
4
- int x1 : 1 ; // compilant: single-bit named field without signed declaration
5
- signed int x2 : 1 ; // non_compilant: single-bit named field with a signed type
4
+ int x1 : 1 ; // NON_COMPILANT: very likely be signed, but if it's not, the
5
+ // query will automatically handle it since we use signed(), not
6
+ // isExplicitlySigned().
7
+ signed int x2 : 1 ; // NON_COMPILANT: single-bit named field with a signed type
6
8
signed char
7
- x3 : 1 ; // non_compilant : single-bit named field with a signed type
9
+ x3 : 1 ; // NON_COMPILANT : single-bit named field with a signed type
8
10
signed short
9
- x4 : 1 ; // non_compilant : single-bit named field with a signed type
11
+ x4 : 1 ; // NON_COMPILANT : single-bit named field with a signed type
10
12
unsigned int
11
- x5 : 1 ; // compilant : single-bit named field but with an unsigned type
12
- signed int x6 : 2 ; // compilant : named field with a signed type but declared
13
+ x5 : 1 ; // COMPILANT : single-bit named field but with an unsigned type
14
+ signed int x6 : 2 ; // COMPILANT : named field with a signed type but declared
13
15
// to carry more than 1 bit
14
- int32_t x7 : 1 ; // non_compilant : single-bit named field that has single-bit
16
+ int32_t x7 : 1 ; // NON_COMPILANT : single-bit named field that has single-bit
15
17
// bit-field, even though technically it has 32 bits
16
- signed char : 1 ; // compilant : single-bit bit-field but unnamed
17
- } sample_struct ;
18
+ signed char : 1 ; // COMPILANT : single-bit bit-field but unnamed
19
+ } sample_struct ;
You can’t perform that action at this time.
0 commit comments