[clang] Rewrite offsetof with __builtin_offsetof with -fms-kernel (PR #193804)

Daniel Paoliello via cfe-commits cfe-commits at lists.llvm.org
Wed May 6 09:39:58 PDT 2026


dpaoliello wrote:

@efriedma-quic there's a lot of existing code that uses this pattern, especially code that is targeting older Windows SDKs (e.g., to supported older versions of Windows).

Unfortunately, the fact that this is currently UB is very worrying as that can have non-local effects: hence why we'd rather have defined behavior for this case (i.e., treating it as "erroneous behavior" instead of UB).

https://github.com/llvm/llvm-project/pull/193804


More information about the cfe-commits mailing list