[clang] [clang][docs] Add note about `-Wms-bitfield-padding` in MSVC compatibility docs (PR #155770)

via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 2 06:26:14 PDT 2026


zahirtezcan-bugs wrote:

i don't know where to ask this but is there a direct link to the Microsoft ABI document? The behavior i observed on MSVC was keeping same type in an alignment window while filling all bits of a type, but clang gives this warning even if that is satisfied.

For example this is compatible between MSVC and clang
```cpp
struct Foo
{
    uint64_t x: 44;
    uint64_t y: 20;
    //struct alignment is 8 bytes, we filled all uint64_t bits so moving to another type should not be a problem
    uint32_t s; 20;
    uint32_t s; 12;
    //we filled 32 bits of uint32_t but alignment window is not filled so we should still continue with uint32_t
    uint32_t a; ;13;
    uint32_t b ;3;
    uint32_t c; ;13;
    uint32_t d ;3;
};
```

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


More information about the cfe-commits mailing list