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

Jan Kratochvil jkratochvil at openjdk.org
Thu Nov 6 19:47:40 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:

  Import some code from Ioi Lam's patch

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/26098/files
  - new: https://git.openjdk.org/jdk/pull/26098/files/3d4eccc1..98bb03eb

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

  Stats: 89 lines in 2 files changed: 6 ins; 77 del; 6 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