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
7c251fe190
commit
06682bd2a9
@ -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
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user