We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a8ff996 + 6cc9c03 commit 12f3221Copy full SHA for 12f3221
src/basic_c_tests/funptr-nested-struct-simple.c
@@ -0,0 +1,30 @@
1
+extern void MAYALIAS(void*,void*);
2
+struct interesting {
3
+ int dummy;
4
+ void (*f1)(int*);
5
+ void (*f2)(int*);
6
+};
7
+
8
+struct nested_ptr {
9
10
+ struct interesting* ptr;
11
12
13
+int g;
14
+void f1(int* a){ MAYALIAS(a, &g);}
15
+void f2(int* a){ MAYALIAS(a, &g);}
16
17
+struct interesting i1 = {
18
+ .f1 = f1,
19
+ .f2 = f2
20
21
22
+struct nested_ptr n1 = {
23
+ .ptr = &i1
24
25
26
+void test_ptr() {
27
+ struct interesting interesting_stub = *n1.ptr;
28
+ interesting_stub.f1(&g);
29
+ interesting_stub.f2(&g);
30
+}
0 commit comments