Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use in a packed struct #101

Open
vervaekejonathan opened this issue May 5, 2021 · 1 comment
Open

Use in a packed struct #101

vervaekejonathan opened this issue May 5, 2021 · 1 comment

Comments

@vervaekejonathan
Copy link

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'

@aantron
Copy link
Owner

aantron commented May 5, 2021

Try adding

#define BETTER_ENUMS_CLASS_ATTRIBUTE __attribute__((packed, aligned(1)))

before the enum. See Injecting tokens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants