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

uuid no longer packable with gcc #160

Open
wkelton opened this issue Jul 26, 2024 · 1 comment
Open

uuid no longer packable with gcc #160

wkelton opened this issue Jul 26, 2024 · 1 comment

Comments

@wkelton
Copy link

wkelton commented Jul 26, 2024

There appears to be a breaking change for uuid in version 1.86 where it cannot be packed in a struct using gcc.

I set up an example showing a 1.85 uuid being packed in a struct, but 1.86 uuid causes a warning from gcc: Compile Explorer

gcc warns:

warning: ignoring packed attribute because of unpacked non-POD field
@pdimov
Copy link
Member

pdimov commented Jul 26, 2024

I wasn't able to make __attribute__((packed)) work reliably after the changes; you'll have to define BOOST_UUID_DISABLE_ALIGNMENT if you need this functionality. (#pragma pack(1) works, though.)

The corresponding tests are

https://github.com/boostorg/uuid/blob/02c82cea9c82e4fdbc32b58e5a2e9f97dfc50755/test/test_attribute_packed.cpp
(which requires BOOST_UUID_DISABLE_ALIGNMENT to pass) and

https://github.com/boostorg/uuid/blob/02c82cea9c82e4fdbc32b58e5a2e9f97dfc50755/test/test_pragma_pack.cpp

which does not.

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