Skip to content

Commit 2e51f7c

Browse files
authored
Merge pull request #182 from github/jeongsoolee09/rule-6-2-compilant
Typo Fixes in test.c for RULE-6-1 and RULE-6-2
2 parents 07495b3 + b8d2b95 commit 2e51f7c

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

c/misra/test/rules/RULE-6-1/test.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ enum Color { R, G, B };
44

55
struct SampleStruct {
66
int x1 : 2; // NON_COMPLIANT - not explicitly signed or unsigned
7-
unsigned int x2 : 2; // COMPILANT - explicitly unsigned
8-
signed int x3 : 2; // COMPILANT - explicitly signed
7+
unsigned int x2 : 2; // COMPLIANT - explicitly unsigned
8+
signed int x3 : 2; // COMPLIANT - explicitly signed
99
UINT16 x4 : 2; // COMPLIANT - type alias resolves to a compliant type
1010
signed long x5 : 2; // NON_COMPLIANT - cannot declare bit field for long, even
1111
// if it's signed
12-
signed char x6 : 2; // NON_COMPILANT - cannot declare bit field for char, even
12+
signed char x6 : 2; // NON_COMPLIANT - cannot declare bit field for char, even
1313
// if it's signed
14-
enum Color x7 : 3; // NON_COMPILANT - cannot declare bit field for enum
14+
enum Color x7 : 3; // NON_COMPLIANT - cannot declare bit field for enum
1515
} sample_struct;

c/misra/test/rules/RULE-6-2/test.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
#include <stdint.h>
22

33
struct SampleStruct {
4-
int x1 : 1; // NON_COMPILANT: very likely be signed, but if it's not, the
4+
int x1 : 1; // NON_COMPLIANT: very likely be signed, but if it's not, the
55
// query will automatically handle it since we use signed(), not
66
// isExplicitlySigned().
7-
signed int x2 : 1; // NON_COMPILANT: single-bit named field with a signed type
7+
signed int x2 : 1; // NON_COMPLIANT: single-bit named field with a signed type
88
signed char
9-
x3 : 1; // NON_COMPILANT: single-bit named field with a signed type
9+
x3 : 1; // NON_COMPLIANT: single-bit named field with a signed type
1010
signed short
11-
x4 : 1; // NON_COMPILANT: single-bit named field with a signed type
11+
x4 : 1; // NON_COMPLIANT: single-bit named field with a signed type
1212
unsigned int
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+
x5 : 1; // COMPLIANT: single-bit named field but with an unsigned type
14+
signed int x6 : 2; // COMPLIANT: named field with a signed type but declared
1515
// to carry more than 1 bit
16-
signed char : 1; // COMPILANT: single-bit bit-field but unnamed
16+
signed char : 1; // COMPLIANT: single-bit bit-field but unnamed
1717
} sample_struct;

0 commit comments

Comments
 (0)