[clang] Add an off-by-default warning to complain about MSVC bitfield padding (PR #117428)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 3 09:29:21 PST 2024
AaronBallman wrote:
> > So I take it we decided not to enable it by default in `-fms-compatibility` mode then?
>
> I don't believe it is appropriate to do so. The intent of this warning is to indicate MSVC compatibility issues when building in non-ms-compatibility modes. The existing padding warnings already trigger for these layouts in the relevant ms compatibility modes
We don't typically add new off-by-default warnings though; users don't enable them often enough to be worth the costs. My thought process is: if we enable this diagnostic by default in `-fms-compatibility` mode as telling the user their bit-fields aren't packing, then it's on by default for some configurations so it meets our bar for inclusion, and it helps us directly because we have Windows precommit (and post-commit) CI coverage for building Clang and LLVM. Users on other platforms can opt-in to the diagnostic if they want the diagnostics for compatibility reasons.
If we want to leave it off by default, then I wonder if we want to roll the functionality into `-Wpadded-bitfield` which already exists and is off by default.
https://github.com/llvm/llvm-project/pull/117428
More information about the cfe-commits
mailing list