mstorsjo wrote:

> One more thing. Re binary compatibility concerns: `-mno-ms-bitfields` on 
> MinGW is an equally-sized footgun as on MSVC. Without proper header 
> annotation with `#pragma ms_struct on`, either of them will silently make an 
> ABI mismatch. However, for some reason, supporting `-mno-ms-bitfields` on 
> MinGW is not argued upon.

I guess this is for historical reasons. Originally the MinGW target had this as 
an opt-in, and this was indeed a silent ABI mismatch. Users who needed to use 
affected structs and interact with Microsoft APIs had to remember to build 
their code with `-mms-bitfields` (and hope they don't link in some code that is 
built without it, with affected structs in their interface). It became the 
default only by GCC 4.7 (in 2012), and we picked up on this way much later in 
Clang, in Clang 11 in 2020.

https://github.com/llvm/llvm-project/pull/71148
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to