RFR: 8357579: Compilation error: first argument in call to 'memset' is a pointer to non-trivially copyable type [v14]

Jan Kratochvil jkratochvil at openjdk.org
Mon Nov 17 21:28:58 UTC 2025


> With clang-20 using --with-toolchain-type=clang resolveFieldEntry.cpp and resolveMethodEntry.cpp break the build with similar warnings like:
> 
> src/hotspot/share/oops/resolvedFieldEntry.cpp:49:10: error: first argument in call to 'memset' is a pointer to non-trivially copyable type 'ResolvedFieldEntry' [-Werror,-Wnontrivial-memcall]
>    49 |   memset(this, 0, sizeof(*this));
>       |          ^
> src/hotspot/share/oops/resolvedFieldEntry.cpp:49:10: note: explicitly cast the pointer to silence this warning
>    49 |   memset(this, 0, sizeof(*this));
>       |          ^
>       |          (void*)
> 
> The patch follows the suggested fix.

Jan Kratochvil has updated the pull request incrementally with one additional commit since the last revision:

  update STATIC_ASSERT->static_assert

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/26098/files
  - new: https://git.openjdk.org/jdk/pull/26098/files/ef3673ca..f85f1066

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=26098&range=13
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26098&range=12-13

  Stats: 4 lines in 2 files changed: 0 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/26098.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/26098/head:pull/26098

PR: https://git.openjdk.org/jdk/pull/26098


More information about the hotspot-dev mailing list