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 void casts to silence warnings about memcpy to a class #3800

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mstorsjo
Copy link
Contributor

@mstorsjo mstorsjo commented Nov 7, 2024

This was previously silenced by passing -Wno-class-memaccess, to the compiler, if it was supported (for GCC, it was supported since GCC 8).

Clang supports a similar option, -Wno-nontrivial-memaccess since Clang 8. It didn't use to warn about these cases, but since Clang 20, it also warns about this.

Simplify handling the issue by just adding void casts, to avoid needing to check for whether the options for silencing the warnings are supported.

This silences these warnings when building with Clang 20.

This was previously silenced by passing -Wno-class-memaccess, to
the compiler, if it was supported (for GCC, it was supported since
GCC 8).

Clang supports a similar option, -Wno-nontrivial-memaccess since
Clang 8. It didn't use to warn about these cases, but since Clang 20,
it also warns about this.

Simplify handling the issue by just adding void casts, to avoid
needing to check for whether the options for silencing the warnings
are supported.
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.

1 participant