RFR: 8357579: Compilation error: first argument in call to 'memset' is a pointer to non-trivially copyable type [v14]
Ioi Lam
iklam at openjdk.org
Tue Nov 18 21:54:44 UTC 2025
On Mon, 17 Nov 2025 21:28:58 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:
>
> update STATIC_ASSERT->static_assert
I tested the latest change in our CI with tiers 1, 2 and build-tier-5. No regression.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26098#issuecomment-3549573028
More information about the hotspot-dev
mailing list