Skip to content

Commit f473520

Browse files
Fix tests for rule-1-4
1 parent 57b4292 commit f473520

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1+
| test.c:2:1:2:22 | #include <stdatomic.h> | Usage of emergent language feature. |
2+
| test.c:4:1:4:20 | #include <threads.h> | Usage of emergent language feature. |
3+
| test.c:6:1:6:49 | #define MACRO(x) _Generic((x), int : 0, long : 1) | Usage of emergent language feature. |
14
| test.c:7:1:7:32 | #define __STDC_WANT_LIB_EXT1__ 1 | Usage of emergent language feature. |
5+
| test.c:12:26:12:40 | atomic_new_type | Usage of emergent language feature. |
6+
| test.c:17:15:17:15 | i | Usage of emergent language feature. |
7+
| test.c:24:27:24:28 | i3 | Usage of emergent language feature. |
8+
| test.c:25:28:25:29 | i4 | Usage of emergent language feature. |

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
#include <stdalign.h> //COMPLIANT
2-
#include <stdatomic.h> //COMPLIANT
2+
#include <stdatomic.h> //NON-COMPLIANT
33
#include <stdnoreturn.h> //COMPLIANT
4-
#include <threads.h> //COMPLIANT
4+
#include <threads.h> //NON-COMPLIANT
55

6-
#define MACRO(x) _Generic((x), int : 0, long : 1) // COMPLIANT
6+
#define MACRO(x) _Generic((x), int : 0, long : 1) // NON-COMPLIANT
77
#define __STDC_WANT_LIB_EXT1__ 1 // NON-COMPLIANT
88

99
_Noreturn void f0(); // COMPLIANT
1010

1111
typedef int new_type; // COMPLIANT
12-
typedef _Atomic new_type atomic_new_type; // COMPLIANT
12+
typedef _Atomic new_type atomic_new_type; // NON-COMPLIANT
1313

1414
void f(int p) {
1515
int i0 = _Generic(p, int : 0, long : 1); // COMPLIANT
1616

17-
_Atomic int i; // COMPLIANT
17+
_Atomic int i; // NON-COMPLIANT
1818

1919
_Alignas(4) int i1; // COMPLIANT
2020
alignas(4) int i2; // COMPLIANT
2121
int a = _Alignof(int); // COMPLIANT
2222
int a1 = alignof(int); // COMPLIANT
2323

24-
static thread_local int i3; // COMPLIANT
25-
static _Thread_local int i4; // COMPLIANT
24+
static thread_local int i3; // NON-COMPLIANT
25+
static _Thread_local int i4; // NON-COMPLIANT
2626
}

0 commit comments

Comments
 (0)