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

Merged
merged 1 commit into from
Nov 18, 2024

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.
@BenzhengZhang BenzhengZhang merged commit 6746bc4 into cisco:master Nov 18, 2024
8 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.

2 participants