Skip to content

Commit b87fec5

Browse files
committed
Add test case with atomic types for documentation
1 parent 4dc49a1 commit b87fec5

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ struct SampleStruct {
1010
signed long x5 : 2; // COMPLIANT
1111
signed char x6 : 2; // COMPLIANT
1212
enum Color x7 : 3; // COMPLIANT
13+
//_Atomic(int) x8 : 2; // NON_COMPLIANT[COMPILER_CHECKED] - atomic types are
14+
//not permitted for bit-fields.
1315
} sample_struct;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ struct SampleStruct {
1010
signed long x5 : 2; // COMPLIANT
1111
signed char x6 : 2; // COMPLIANT
1212
enum Color x7 : 3; // COMPLIANT
13+
//_Atomic(int) x8 : 2; // NON_COMPLIANT[COMPILER_CHECKED] - atomic types are
14+
//not permitted for bit-fields.
1315
} sample_struct;

0 commit comments

Comments
 (0)