From a571c4ba338fcf56c4aba312c189c36c855fda6c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 4 Sep 2016 12:56:17 +0200 Subject: [PATCH] tag/Item: remove "packed" attribute, add static_assert on alignment instead The "packed" attribute triggers a clang 4.0 warning, and it's not necessary. All we want is correct allocation of this dynamically-sized struct. --- src/tag/TagItem.hxx | 5 +++-- src/tag/TagPool.cxx | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tag/TagItem.hxx b/src/tag/TagItem.hxx index de9d59cb8..7e212146b 100644 --- a/src/tag/TagItem.hxx +++ b/src/tag/TagItem.hxx @@ -21,7 +21,6 @@ #define MPD_TAG_ITEM_HXX #include "TagType.h" -#include "Compiler.h" /** * One tag value. It is a mapping of #TagType to am arbitrary string @@ -40,6 +39,8 @@ struct TagItem { TagItem() = default; TagItem(const TagItem &other) = delete; TagItem &operator=(const TagItem &other) = delete; -} gcc_packed; +}; + +static_assert(alignof(TagItem) == 1, "Unexpected alignment"); #endif diff --git a/src/tag/TagPool.cxx b/src/tag/TagPool.cxx index efa9cd544..71bb563b9 100644 --- a/src/tag/TagPool.cxx +++ b/src/tag/TagPool.cxx @@ -51,7 +51,7 @@ struct TagPoolSlot { static TagPoolSlot *Create(TagPoolSlot *_next, TagType type, StringView value); -} gcc_packed; +}; TagPoolSlot * TagPoolSlot::Create(TagPoolSlot *_next, TagType type,