Messages in this thread | | | From | YingChi Long <> | Subject | RE: [PATCH v2] x86/fpu: use _Alignof to avoid UB in TYPE_ALIGN | Date | Wed, 28 Sep 2022 01:07:02 +0800 |
| |
In LLVM Phab we have discussed difference between using offsetof and _Alignof.
> Technically there's no requirement that they return the same value (the > structure could insert arbitrary padding, including no padding), so it's > theoretically possible they return different values. But I can't think of a > situation in which you'd get a different answer from `TYPE_ALIGN` as you > would get from `_Alignof`.
Link: https://reviews.llvm.org/D133574#3815253
| |