Cydox wrote:

The expression can be simplified to:

```C
round_up(
    alignof(struct S)
    offsetof(struct S, fam) + count * sizeof(((struct S *)0)->fam[0])
)
```
As the padding at the end of the structure is always smaller than the alignof.
So `round_up(alignof(struct S), offsetof(struct S, fam)) = sizeof(struct S)`

https://github.com/llvm/llvm-project/pull/112636
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to