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

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

  More code improvements from Ioi Lam's patch

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

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

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

  Stats: 48 lines in 4 files changed: 24 ins; 22 del; 2 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