better-enums
better-enums copied to clipboard
Use in a packed struct
BETTER_ENUM(address_t, uint8_t, one = 0x01, two = 0x02);
struct query_t {
address_t address;
} __attribute__((packed, aligned(1)));
Gives a warning:
ignoring packed attribute because of unpacked non-POD field 'address_t query_t::address'
Try adding
#define BETTER_ENUMS_CLASS_ATTRIBUTE __attribute__((packed, aligned(1)))
before the enum. See Injecting tokens.