RFR: 8266172: -Wstringop-overflow happens in vmError.cpp

Yasumasa Suenaga ysuenaga at openjdk.java.net
Thu May 6 07:41:52 UTC 2021


On Thu, 6 May 2021 07:14:41 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> We can see following compiler warnings in vmError.cpp on GCC 11.
>> 
>> 
>> In function 'void crash_with_segfault()',
>>     inlined from 'static void VMError::controlled_crash(int)' at /home/ysuenaga/github-forked/jdk/src/hotspot/share/utilities/vmError.cpp:1804:33:
>
> I'm fine with this patch. 
> 
> nit: does the C++ styleguide require C++ casts now? I don't remember seeing anything. I dislike the verbosity of these casts.
> 
> Cheers, Thomas

Thanks @tstuefe for the review!

> does the C++ styleguide require C++ casts now? I don't remember seeing anything.

Me too, but I found 745 entries when I grep'ed HotSpot source with `'_cast<'`, and also HotSpot is starting to use C++ 14 since JEP 347. So I decided to use C++ casts at here.

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

PR: https://git.openjdk.java.net/jdk/pull/3789


More information about the hotspot-dev mailing list