Jan. 18, 2024
7:14 a.m.
`calloc(1, offsetof(struct bla, array[count]))`
That's not how the C standard shows how you should allocate struct with flexible member. This is the example: ```c int m = /* some value */; struct s *p = malloc(sizeof(struct s) + sizeof(double [m])); ``` * * * I think worst case here is we would allocate a few more bytes? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/4852#note_57925