diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-04-23 11:18:56 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-04-23 13:27:11 +0200 |
commit | 9eba8aa38db3a0dc2f7dfaf24a003c16418aef18 (patch) | |
tree | 271ec6c6526dd15d165a932d69e6e73c40ac5453 | |
parent | 7c1e22152ed1a1837782a55fc9997f8e7801681b (diff) |
Remove dubious #pragma pack
...that were introduced with bca539e889d40e06cb3275442622cb075b2484a2 "make
OString(OStringLiteral) constructor constexpr", apparently to mimic the
corresponding #pragma pack for rtl_String in include/rtl/string.h. But neither
of them appear to have any value: All struct member types involved
(oslInterlockedCount aka sal_Int32, sal_Int32 itself, and char) have size < 8,
so the member alignment ("on a boundary that's either a multiple of [the pragma
pack value], or a multiple of the size of the member, whichever is smaller",
according to
<https://docs.microsoft.com/en-us/cpp/preprocessor/pack?view=msvc-160>) is not
affected. And neither are alignof(rtl_String) and alignof(OStringLiteral<N>)
affected, which remain e.g. 4 on x86-64. (And prior to
bca539e889d40e06cb3275442622cb075b2484a2, OStringLiteral did not have any pragma
pack cargo cult, but which did not cause OStringLiteral::assertLayout to fail,
or raise any other documented issues.)
So remove the pragma pack cargo cult again at least from OStringLiteral. (And
leave potential removal from rtl_String for another commit.)
(This is similar to the corresponding f62cb40bdfaf41cf8e989640f9be79f652f30914
"Remove dubious #pragma pack" for OUStringLiteral.)
Change-Id: I7808837a667bca717aa2e3abfdf9cb16268789ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114535
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | include/rtl/string.hxx | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/include/rtl/string.hxx b/include/rtl/string.hxx index 98abce8fca53..a6812cc7c7df 100644 --- a/include/rtl/string.hxx +++ b/include/rtl/string.hxx @@ -134,9 +134,6 @@ private: static_assert(offsetof(OStringLiteral, str.buffer) == offsetof(OStringLiteral, more.buffer)); } -#if defined(_WIN32) -#pragma pack(push, 8) -#endif union { rtl_String str; struct { @@ -150,9 +147,6 @@ private: {} //TODO: drop initialization for C++20 (P1331R2) }; }; -#if defined(_WIN32) -#pragma pack(pop) -#endif }; #endif |