[libcxx-commits] [PATCH] D128285: [libc++][AIX] Make basic_string layout compatible with earlier version

Hubert Tong via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 21 16:58:20 PDT 2022


hubert.reinterpretcast added inline comments.


================
Comment at: libcxx/include/string:724
 
-    struct __long
+_LIBCPP_PACKED_BYTE_FOR_AIX
+    struct __long_impl
----------------
philnik wrote:
> How exactly is this different from using `__atrribute__((__packed__))`? If it's not I would suggest to put `__is_long_` and `__cap_` into it's own struct and mark only that as `__attribute__((__packed__))`to avoid the explicit padding and `alignas()` specifiers.
That should work. Any preference between base class, anonymous struct, or named member?

The named member version is the most pragmatic (does not change whether the type is standard layout, does not use language extension).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128285/new/

https://reviews.llvm.org/D128285



More information about the libcxx-commits mailing list