public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* [[gcc_struct]] potential clang compatibility concerns
@ 2023-12-02 21:50 Dan Klishch
  2024-01-13 17:12 ` Dan Klishch
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Klishch @ 2023-12-02 21:50 UTC (permalink / raw)
  To: gcc

Hi,

In the discussion of LLVM's PR adding `[[gnu::gcc_struct]]` support to Clang
(https://github.com/llvm/llvm-project/pull/71148), maintainers asked
me to make sure that whatever
is done there, makes sense for GCC too.

To summarize the long discussion on GitHub, GCC supports gcc_struct,
ms_struct, and
`-m{no-,}ms-bitfields` only on X86, while Clang currently supports ms_struct and
`-m{no-,}ms-bitfields` on all targets with Itanium C++ ABI.
Correspondingly, my PR adds support for
gcc_struct for all targets with the Itanium C++ ABI and paves the road
for gcc_struct and ms_struct
support on targets with Microsoft C++ ABI (mainly,
x86_64-pc-windows-msvc). There, I envision
`ms_struct` to be a no-op (just like `gcc_struct` is usually a no-op
with Itanium C++ ABI) and
`gcc_struct` to change layout of C structs (or fields within C++
classes) to be compatible with the
GenericItanium C++ ABI.

As far as I can tell, the maintainer's question is "in a theoretical
event GCC starts supporting
Microsoft C++ ABI, would it make sense to implement gcc_struct and
ms_struct on it just like I
propose to?".

Thanks,
Dan Klishch

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-13 17:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-02 21:50 [[gcc_struct]] potential clang compatibility concerns Dan Klishch
2024-01-13 17:12 ` Dan Klishch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).