We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 94347c4 commit 741ab39Copy full SHA for 741ab39
c/cert/test/rules/EXP39-C/test.c
@@ -78,4 +78,22 @@ int g(signed int x) { return x; }
78
void test_compatible_functions() {
79
signed (*f1)(int) = &g; // COMPLIANT
80
int (*g1)(signed int) = &f; // COMPLIANT
81
+}
82
+
83
+struct S2 {
84
+ int a;
85
+ int b;
86
+};
87
88
+struct S3 {
89
90
91
92
93
+void test_realloc() {
94
+ struct S2 *s2 = (struct S2 *)malloc(sizeof(struct S2));
95
+ struct S3 *s3 = (struct S3 *)realloc(s2, sizeof(struct S3));
96
+ s3->a; // NON_COMPLIANT
97
+ memset(s3, 0, sizeof(struct S3));
98
+ s3->a; // COMPLIANT
99
}
0 commit comments