[libcxx-commits] [PATCH] D121009: [libc++] Simplify how __format_spec::_Flags is packed on AIX

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Mar 4 10:51:34 PST 2022


ldionne added inline comments.


================
Comment at: libcxx/include/__format/parser_std_format_spec.h:49
+# define _LIBCPP_PACK_FLAGS_ON_AIX
+#endif
+
----------------
Quuxplusone wrote:
> Hm, counter-argument: unless we're going to `#undef` this at the end of the header, it feels like this //is// something generic that might get copy-pasted around, and would have to move into a shared header at that point to avoid multiple definitions. If we're going to localize it into this one file, personally I'd prefer just
> ```
> #ifdef _AIX
> class _LIBCPP_TYPE_VIS __attribute__((__packed__)) _Flags {
> #else
> class _LIBCPP_TYPE_VIS _Flags {
> #endif // _AIX
> ```
> (But I don't care much.)
Agreed, I like yours better.

@hubert.reinterpretcast I think it would be necessary to know whether this will have to be repeated in many places. I actually don't quite understand what makes this struct so special -- why the compiler packs it on all platforms except AIX. CC @Mordante 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121009



More information about the libcxx-commits mailing list