RFR: 8357579: Compilation error: first argument in call to 'memset' is a pointer to non-trivially copyable type [v13]
Ashutosh Mehra
asmehra at openjdk.org
Mon Nov 10 22:18:03 UTC 2025
On Mon, 10 Nov 2025 07:24:50 GMT, Jan Kratochvil <jkratochvil at openjdk.org> wrote:
>> 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:
>
> Add Ioi Lam's comment
Marked as reviewed by asmehra (Committer).
lgtm
-------------
PR Review: https://git.openjdk.org/jdk/pull/26098#pullrequestreview-3445383353
PR Comment: https://git.openjdk.org/jdk/pull/26098#issuecomment-3514110147
More information about the hotspot-dev
mailing list