Skip to content

Commit d86b532

Browse files
committed
Declarations3: add missing testcase prev RULE-5-3
1 parent 24a99a1 commit d86b532

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
No expected results have yet been specified
1+
| test.c:4:7:4:9 | id1 | Variable is hiding variable $@. | test.c:1:5:1:7 | id1 | id1 |
2+
| test.c:7:13:7:15 | id1 | Variable is hiding variable $@. | test.c:1:5:1:7 | id1 | id1 |
3+
| test.c:10:12:10:14 | id1 | Variable is hiding variable $@. | test.c:1:5:1:7 | id1 | id1 |
4+
| test.c:11:14:11:16 | id1 | Variable is hiding variable $@. | test.c:10:12:10:14 | id1 | id1 |
5+
| test.c:24:24:24:26 | id2 | Variable is hiding variable $@. | test.c:22:5:22:7 | id2 | id2 |
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
int id1;
2+
3+
void f1() {
4+
int id1; // NON_COMPLIANT
5+
}
6+
7+
void f2(int id1) {} // NON_COMPLIANT
8+
9+
void f3() {
10+
for (int id1; id1 < 1; id1++) { // NON_COMPLIANT
11+
for (int id1; id1 < 1; id1++) {
12+
} // NON_COMPLIANT
13+
}
14+
}
15+
16+
struct astruct {
17+
int id1;
18+
};
19+
20+
extern void g(struct astruct *p);
21+
22+
int id2 = 0;
23+
24+
void f4(struct astruct id2) { // NON_COMPLIANT
25+
g(&id2);
26+
}
27+
28+
void f5(struct astruct id3) { // COMPLIANT
29+
g(&id2);
30+
}

0 commit comments

Comments
 (0)