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:
parent
889be6e29d
commit
a571c4ba33
@ -21,7 +21,6 @@
|
|||||||
#define MPD_TAG_ITEM_HXX
|
#define MPD_TAG_ITEM_HXX
|
||||||
|
|
||||||
#include "TagType.h"
|
#include "TagType.h"
|
||||||
#include "Compiler.h"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* One tag value. It is a mapping of #TagType to am arbitrary string
|
* One tag value. It is a mapping of #TagType to am arbitrary string
|
||||||
@ -40,6 +39,8 @@ struct TagItem {
|
|||||||
TagItem() = default;
|
TagItem() = default;
|
||||||
TagItem(const TagItem &other) = delete;
|
TagItem(const TagItem &other) = delete;
|
||||||
TagItem &operator=(const TagItem &other) = delete;
|
TagItem &operator=(const TagItem &other) = delete;
|
||||||
} gcc_packed;
|
};
|
||||||
|
|
||||||
|
static_assert(alignof(TagItem) == 1, "Unexpected alignment");
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -51,7 +51,7 @@ struct TagPoolSlot {
|
|||||||
|
|
||||||
static TagPoolSlot *Create(TagPoolSlot *_next, TagType type,
|
static TagPoolSlot *Create(TagPoolSlot *_next, TagType type,
|
||||||
StringView value);
|
StringView value);
|
||||||
} gcc_packed;
|
};
|
||||||
|
|
||||||
TagPoolSlot *
|
TagPoolSlot *
|
||||||
TagPoolSlot::Create(TagPoolSlot *_next, TagType type,
|
TagPoolSlot::Create(TagPoolSlot *_next, TagType type,
|
||||||
|
Loading…
Reference in New Issue
Block a user