From 06682bd2a95692153327b483a06ffa709a842e6b 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 489ecde3a..86c9646ef 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 16f44f46e..22dc2a05d 100644 --- a/src/tag/TagPool.cxx +++ b/src/tag/TagPool.cxx @@ -50,7 +50,7 @@ struct TagPoolSlot { static TagPoolSlot *Create(TagPoolSlot *_next, TagType type, const char *value, size_t length); -} gcc_packed; +}; TagPoolSlot * TagPoolSlot::Create(TagPoolSlot *_next, TagType type,