diff options
author | Oliver Hunt <oliver@apple.com> | 2025-08-28 00:01:13 -0700 |
---|---|---|
committer | Oliver Hunt <oliver@apple.com> | 2025-08-29 13:23:15 -0700 |
commit | cc25a94f6f2e28e386b00ca8feee4d2c53c1ee01 (patch) | |
tree | f59e3cd8d8b182cf095e0be1bbd2b78cd3c40722 | |
parent | 58bf9aca21d5e3a6b284802a6ad97319c5719221 (diff) | |
download | llvm-users/ojhunt/ms-bitfield-padding-doc.zip llvm-users/ojhunt/ms-bitfield-padding-doc.tar.gz llvm-users/ojhunt/ms-bitfield-padding-doc.tar.bz2 |
[clang][docs] Add note about `-Wms-bitfield-padding` in MSVC compatibility docsusers/ojhunt/ms-bitfield-padding-doc
-rw-r--r-- | clang/docs/MSVCCompatibility.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/docs/MSVCCompatibility.rst b/clang/docs/MSVCCompatibility.rst index b4a7d23..63c8d8e 100644 --- a/clang/docs/MSVCCompatibility.rst +++ b/clang/docs/MSVCCompatibility.rst @@ -284,3 +284,9 @@ Since `__m128` is not a class type in clang any overloads after a template defin With MSVC ``foo(__m128)`` will be selected but with clang ``foo<__m128>()`` will be selected since on clang `__m128` is a builtin type. In general the takeaway is `__m128` is a builtin type on clang while a class type on MSVC. + +Warnings +======== + +* ``-Wms-bitfield-padding`` + When generating code compatible with MSVC, clang applies the bit-field padding ABI used by MSVC. The padding behavior of sequential bit-fields in a record's layout is dependent on whether the underlying storage type of those bit-fields are the same. To help diagnose unexpected padding the ``-Wms-bitfield-padding`` warning can be used to diagnose cases where the MSVC ABI will not pad bit-fields (even if not targeting relevant platforms). |