RFR: 8313552: Fix -Wconversion warnings in JFR code

Markus Grönlund mgronlun at openjdk.org
Fri Aug 4 15:26:33 UTC 2023


On Fri, 4 Aug 2023 15:08:23 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> Greetings,
>> 
>> this change set removes -Wconversion warnings in the JFR code.
>> 
>> Testing: jdk_jfr
>> 
>> Thanks
>> Markus
>
> src/hotspot/share/jfr/periodic/jfrPeriodic.cpp line 437:
> 
>> 435:   EventGCSurvivorConfiguration event;
>> 436:   event.set_maxTenuringThreshold(static_cast<u1>(conf.max_tenuring_threshold()));
>> 437:   event.set_initialTenuringThreshold(static_cast<u1>(conf.initial_tenuring_threshold()));
> 
> The Wconversion team has been preferring checked_cast<> for all narrowing casts.

Are you saying that static_cast should not be used, but checked_cast should?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15152#discussion_r1284559594


More information about the hotspot-jfr-dev mailing list