Debian Codegraph @

subprojects/fontconfig/meson-cc-tests/flexible-array-member-test.c

raw
1 #include <stddef.h>
2 #include <stdio.h>
3 #include <stdlib.h>
4
5 struct s {
6 int n;
7 double d[];
8 };
9
10 int
11 main (void)
12 {
13 int m = getchar();
14 struct s *p = malloc (offsetof (struct s, d) + m * sizeof (double));
15 p->d[0] = 0.0;
16 return p->d != (double *)NULL;
17 }