Skip to content

crn_decomp.h: warning: first argument in call to 'memcpy' is a pointer to non-trivially copyable type with Clang 20 #81

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

Open
illwieckz opened this issue Mar 17, 2025 · 0 comments · May be fixed by #82

Comments

@illwieckz
Copy link
Member

illwieckz commented Mar 17, 2025

Reported by Clang 20 when building the Dæmon game engine:

crunch/inc/crn_decomp.h:1459:12:
 warning: first argument in call to 'memcpy' is a pointer to non-trivially copyable type
 'crnd::prefix_coding::decoder_tables' [-Wnontrivial-memcall]
 1459 |     memcpy(this, &other, sizeof(*this));
      |            ^
crunch/inc/crn_decomp.h:1459:12: note: explicitly cast the pointer to silence this warning
 1459 |     memcpy(this, &other, sizeof(*this));
      |            ^
      |            (void*)
@illwieckz illwieckz changed the title crn_decomp.h: warning: first argument in call to 'memcpy' is a pointer to non-trivially copyable type crn_decomp.h: warning: first argument in call to 'memcpy' is a pointer to non-trivially copyable type with Clang 20 Mar 17, 2025
@illwieckz illwieckz linked a pull request Mar 17, 2025 that will close this issue
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 a pull request may close this issue.

1 participant