RFR: 8357579: Compilation error: first argument in call to 'memset' is a pointer to non-trivially copyable type [v4]
Jan Kratochvil
jkratochvil at openjdk.org
Thu Nov 6 19:37:49 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 with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:
- Use padding fields for ResolvedFieldEntry and ResolvedMethodEntry
- Merge branch 'master' into clangmemset
- Merge branch 'master' into clangmemset
- Revert "8361288: Fix build of JTReg: wget exited with exit code 4"
This reverts commit 6e6b8f6a26f8e555f1e70544546b92bbafcae6cc.
- 8361288: Fix build of JTReg: wget exited with exit code 4
- 8357579: Compilation error: first argument in call to 'memset' is a pointer to non-trivially copyable type
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/26098/files
- new: https://git.openjdk.org/jdk/pull/26098/files/3745a8af..3d4eccc1
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=26098&range=03
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=26098&range=02-03
Stats: 14222 lines in 372 files changed: 8523 ins; 4457 del; 1242 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