RFR: 8353365: TOUCH_ASSERT_POISON clears GetLastError() [v2]

David Holmes dholmes at openjdk.org
Sun Apr 6 22:50:28 UTC 2025


On Fri, 4 Apr 2025 07:44:53 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> David Holmes has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Adjust format specifier and remove cast
>
> test/hotspot/gtest/utilities/test_vmerror.cpp line 38:
> 
>> 36:                    "fatal error: GetLastError should be 6 - actually: 6") {
>> 37:   SetLastError(6);
>> 38:   fatal("GetLastError should be 6 - actually: %d", (int)GetLastError());
> 
> Why is this casting the value of GetLastError, rather than using "%u" in the format string?

Simply because when I initially was testing this I used a call that had `%d` as the "template" - see e.g. perfMemory_windows.cpp. But for consistency with other uses in os_windows.cpp I should be using `%lu` and no cast.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24435#discussion_r2030292688


More information about the hotspot-dev mailing list