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.
This commit is contained in:
Max Kellermann 2016-09-04 12:56:17 +02:00
parent 889be6e29d
commit a571c4ba33
2 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -51,7 +51,7 @@ struct TagPoolSlot {
static TagPoolSlot *Create(TagPoolSlot *_next, TagType type,
StringView value);
} gcc_packed;
};
TagPoolSlot *
TagPoolSlot::Create(TagPoolSlot *_next, TagType type,