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 bsl::memcpy to fix strict aliasing errors #18

Merged
merged 2 commits into from
Nov 2, 2023

Conversation

ahsanabbas123
Copy link
Contributor

Problem statement

While building with vcpkg on linux x86_64, we get errors due to strict aliasing not being complied with - as mentioned in microsoft/vcpkg#34797.

error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  379 |             *reinterpret_cast<const bsl::uint64_t*>(&val); 

Proposed changes

We use bsl::memcpy instead.

@willhoy willhoy merged commit 4ef2f80 into bloomberg:main Nov 2, 2023
5 checks passed
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

Successfully merging this pull request may close these issues.

3 participants