Skip to content

Commit 70c776a

Browse files
committed
RULE-8-7: Restructure test
Move single translation unit items into the translation unit, not the shared header.
1 parent 7317d11 commit 70c776a

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
| test.h:2:12:2:13 | i1 | Declaration with external linkage is accessed in only one translation unit $@. | test.c:4:3:4:4 | i1 | i1 |
2-
| test.h:3:5:3:6 | i2 | Declaration with external linkage is accessed in only one translation unit $@. | test.c:5:3:5:4 | i2 | i2 |
3-
| test.h:5:13:5:14 | f2 | Declaration with external linkage is accessed in only one translation unit $@. | test.c:7:3:7:4 | call to f2 | call to f2 |
1+
| test.c:2:5:2:6 | i2 | Declaration with external linkage is accessed in only one translation unit $@. | test.c:8:3:8:4 | i2 | i2 |
2+
| test.h:2:12:2:13 | i1 | Declaration with external linkage is accessed in only one translation unit $@. | test.c:7:3:7:4 | i1 | i1 |
3+
| test.h:4:13:4:14 | f2 | Declaration with external linkage is accessed in only one translation unit $@. | test.c:10:3:10:4 | call to f2 | call to f2 |

c/misra/test/rules/RULE-8-7/test.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#include "test.h"
2+
int i2; // NON_COMPLIANT - accessed one translation unit
3+
static void f3(); // COMPLIANT - internal linkage
4+
extern void f3(); // COMPLIANT - internal linkage
25
void f() {
36
i = 0;
47
i1 = 0;

c/misra/test/rules/RULE-8-7/test.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
extern int i; // COMPLIANT - accessed multiple translation units
22
extern int i1; // NON_COMPLIANT - accessed one translation unit
3-
int i2; // NON_COMPLIANT - accessed one translation unit
43
extern void f1(); // COMPLIANT - accessed multiple translation units
5-
extern void f2(); // NON_COMPLIANT - accessed one translation unit
6-
static void f3(); // COMPLIANT - internal linkage
7-
extern void f3(); // COMPLIANT - internal linkage
4+
extern void f2(); // NON_COMPLIANT - accessed one translation unit

0 commit comments

Comments
 (0)