Skip to content

Commit 009fc65

Browse files
author
Nikita Kraiouchkine
committed
EXP39-C: Remove redundant "TODO" comment from test-case
1 parent 3a3a6a5 commit 009fc65

File tree

3 files changed

+40
-40
lines changed

3 files changed

+40
-40
lines changed

c/cert/src/rules/EXP39-C/DoNotAccessVariableViaPointerOfIncompatibleType.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ Type compatibleTypes(Type type) {
153153
) and
154154
(
155155
(
156+
// all types are compatible with void and explicitly-unsigned char types
156157
result instanceof UnsignedCharType or
157158
[result.stripTopLevelSpecifiers(), type.stripTopLevelSpecifiers()] instanceof VoidType
158159
)
Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
edges
2-
| test.c:50:8:50:9 | s3 | test.c:51:8:51:9 | s1 |
3-
| test.c:61:16:61:18 | E1A | test.c:62:16:62:17 | e1 |
4-
| test.c:61:16:61:18 | E1A | test.c:66:10:66:12 | & ... |
5-
| test.c:69:22:69:22 | v | test.c:69:41:69:41 | v |
6-
| test.c:73:13:73:15 | & ... | test.c:69:22:69:22 | v |
7-
| test.c:75:13:75:15 | & ... | test.c:69:22:69:22 | v |
8-
| test.c:98:32:98:37 | call to malloc | test.c:99:40:99:41 | s2 |
9-
| test.c:98:32:98:37 | call to malloc | test.c:99:40:99:41 | s2 |
10-
| test.c:99:32:99:38 | call to realloc | test.c:100:3:100:4 | s3 |
11-
| test.c:99:32:99:38 | call to realloc | test.c:101:10:101:11 | s3 |
12-
| test.c:99:40:99:41 | s2 | test.c:99:32:99:38 | call to realloc |
2+
| test.c:49:8:49:9 | s3 | test.c:50:8:50:9 | s1 |
3+
| test.c:60:16:60:18 | E1A | test.c:61:16:61:17 | e1 |
4+
| test.c:60:16:60:18 | E1A | test.c:65:10:65:12 | & ... |
5+
| test.c:68:22:68:22 | v | test.c:68:41:68:41 | v |
6+
| test.c:72:13:72:15 | & ... | test.c:68:22:68:22 | v |
7+
| test.c:74:13:74:15 | & ... | test.c:68:22:68:22 | v |
8+
| test.c:97:32:97:37 | call to malloc | test.c:98:40:98:41 | s2 |
9+
| test.c:97:32:97:37 | call to malloc | test.c:98:40:98:41 | s2 |
10+
| test.c:98:32:98:38 | call to realloc | test.c:99:3:99:4 | s3 |
11+
| test.c:98:32:98:38 | call to realloc | test.c:100:10:100:11 | s3 |
12+
| test.c:98:40:98:41 | s2 | test.c:98:32:98:38 | call to realloc |
1313
nodes
1414
| test.c:6:19:6:20 | & ... | semmle.label | & ... |
1515
| test.c:11:10:11:11 | & ... | semmle.label | & ... |
@@ -23,38 +23,38 @@ nodes
2323
| test.c:29:13:29:15 | & ... | semmle.label | & ... |
2424
| test.c:30:19:30:21 | & ... | semmle.label | & ... |
2525
| test.c:31:16:31:18 | & ... | semmle.label | & ... |
26-
| test.c:48:8:48:9 | s2 | semmle.label | s2 |
27-
| test.c:50:8:50:9 | s3 | semmle.label | s3 |
28-
| test.c:50:8:50:9 | s3 | semmle.label | s3 |
29-
| test.c:51:8:51:9 | s1 | semmle.label | s1 |
30-
| test.c:61:16:61:18 | E1A | semmle.label | E1A |
31-
| test.c:61:16:61:18 | E1A | semmle.label | E1A |
32-
| test.c:62:16:62:17 | e1 | semmle.label | e1 |
33-
| test.c:66:10:66:12 | & ... | semmle.label | & ... |
34-
| test.c:69:22:69:22 | v | semmle.label | v |
35-
| test.c:69:41:69:41 | v | semmle.label | v |
36-
| test.c:73:13:73:15 | & ... | semmle.label | & ... |
37-
| test.c:73:13:73:15 | & ... | semmle.label | & ... |
38-
| test.c:75:13:75:15 | & ... | semmle.label | & ... |
39-
| test.c:75:13:75:15 | & ... | semmle.label | & ... |
40-
| test.c:98:32:98:37 | call to malloc | semmle.label | call to malloc |
41-
| test.c:98:32:98:37 | call to malloc | semmle.label | call to malloc |
42-
| test.c:99:32:99:38 | call to realloc | semmle.label | call to realloc |
43-
| test.c:99:32:99:38 | call to realloc | semmle.label | call to realloc |
44-
| test.c:99:32:99:38 | call to realloc | semmle.label | call to realloc |
45-
| test.c:99:40:99:41 | s2 | semmle.label | s2 |
46-
| test.c:99:40:99:41 | s2 | semmle.label | s2 |
47-
| test.c:100:3:100:4 | s3 | semmle.label | s3 |
48-
| test.c:101:10:101:11 | s3 | semmle.label | s3 |
26+
| test.c:47:8:47:9 | s2 | semmle.label | s2 |
27+
| test.c:49:8:49:9 | s3 | semmle.label | s3 |
28+
| test.c:49:8:49:9 | s3 | semmle.label | s3 |
29+
| test.c:50:8:50:9 | s1 | semmle.label | s1 |
30+
| test.c:60:16:60:18 | E1A | semmle.label | E1A |
31+
| test.c:60:16:60:18 | E1A | semmle.label | E1A |
32+
| test.c:61:16:61:17 | e1 | semmle.label | e1 |
33+
| test.c:65:10:65:12 | & ... | semmle.label | & ... |
34+
| test.c:68:22:68:22 | v | semmle.label | v |
35+
| test.c:68:41:68:41 | v | semmle.label | v |
36+
| test.c:72:13:72:15 | & ... | semmle.label | & ... |
37+
| test.c:72:13:72:15 | & ... | semmle.label | & ... |
38+
| test.c:74:13:74:15 | & ... | semmle.label | & ... |
39+
| test.c:74:13:74:15 | & ... | semmle.label | & ... |
40+
| test.c:97:32:97:37 | call to malloc | semmle.label | call to malloc |
41+
| test.c:97:32:97:37 | call to malloc | semmle.label | call to malloc |
42+
| test.c:98:32:98:38 | call to realloc | semmle.label | call to realloc |
43+
| test.c:98:32:98:38 | call to realloc | semmle.label | call to realloc |
44+
| test.c:98:32:98:38 | call to realloc | semmle.label | call to realloc |
45+
| test.c:98:40:98:41 | s2 | semmle.label | s2 |
46+
| test.c:98:40:98:41 | s2 | semmle.label | s2 |
47+
| test.c:99:3:99:4 | s3 | semmle.label | s3 |
48+
| test.c:100:10:100:11 | s3 | semmle.label | s3 |
4949
subpaths
5050
#select
5151
| test.c:6:19:6:20 | & ... | test.c:6:19:6:20 | & ... | test.c:6:19:6:20 | & ... | Cast from float to int results in an incompatible pointer base type. |
5252
| test.c:11:10:11:11 | & ... | test.c:11:10:11:11 | & ... | test.c:11:10:11:11 | & ... | Cast from short[2] to int results in an incompatible pointer base type. |
5353
| test.c:13:17:13:19 | & ... | test.c:13:17:13:19 | & ... | test.c:13:17:13:19 | & ... | Cast from short[2] to short[4] results in an incompatible pointer base type. |
5454
| test.c:19:18:19:20 | & ... | test.c:19:18:19:20 | & ... | test.c:19:18:19:20 | & ... | Cast from char to signed char results in an incompatible pointer base type. |
5555
| test.c:30:19:30:21 | & ... | test.c:30:19:30:21 | & ... | test.c:30:19:30:21 | & ... | Cast from int to unsigned int results in an incompatible pointer base type. |
56-
| test.c:48:8:48:9 | s2 | test.c:48:8:48:9 | s2 | test.c:48:8:48:9 | s2 | Cast from struct <unnamed> to struct <unnamed> results in an incompatible pointer base type. |
57-
| test.c:50:8:50:9 | s3 | test.c:50:8:50:9 | s3 | test.c:50:8:50:9 | s3 | Cast from S1 to struct <unnamed> results in an incompatible pointer base type. |
58-
| test.c:51:8:51:9 | s1 | test.c:51:8:51:9 | s1 | test.c:51:8:51:9 | s1 | Cast from struct <unnamed> to S1 results in an incompatible pointer base type. |
59-
| test.c:69:41:69:41 | v | test.c:73:13:73:15 | & ... | test.c:69:41:69:41 | v | Cast from float to int results in an incompatible pointer base type. |
60-
| test.c:100:3:100:4 | s3 | test.c:99:40:99:41 | s2 | test.c:100:3:100:4 | s3 | Cast from S2 to S3 results in an incompatible pointer base type. |
56+
| test.c:47:8:47:9 | s2 | test.c:47:8:47:9 | s2 | test.c:47:8:47:9 | s2 | Cast from struct <unnamed> to struct <unnamed> results in an incompatible pointer base type. |
57+
| test.c:49:8:49:9 | s3 | test.c:49:8:49:9 | s3 | test.c:49:8:49:9 | s3 | Cast from S1 to struct <unnamed> results in an incompatible pointer base type. |
58+
| test.c:50:8:50:9 | s1 | test.c:50:8:50:9 | s1 | test.c:50:8:50:9 | s1 | Cast from struct <unnamed> to S1 results in an incompatible pointer base type. |
59+
| test.c:68:41:68:41 | v | test.c:72:13:72:15 | & ... | test.c:68:41:68:41 | v | Cast from float to int results in an incompatible pointer base type. |
60+
| test.c:99:3:99:4 | s3 | test.c:98:40:98:41 | s2 | test.c:99:3:99:4 | s3 | Cast from S2 to S3 results in an incompatible pointer base type. |

c/cert/test/rules/EXP39-C/test.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ struct S1 {
4242
} * s3;
4343
struct S1 *s4;
4444

45-
// TODO test across files
4645
void test_incompatible_structs() {
4746
// s1 and s2 do not have tags, and are therefore not compatible
4847
s1 = s2; // NON_COMPLIANT

0 commit comments

Comments
 (0)