RFR: 8296812: sprintf is deprecated in Xcode 14 [v17]
Laurent Bourgès
lbourges at openjdk.org
Wed Dec 7 16:02:21 UTC 2022
On Wed, 7 Dec 2022 08:35:52 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> Xue-Lei Andrew Fan has updated the pull request incrementally with one additional commit since the last revision:
>>
>> comment for snprintf_checked
>
> src/hotspot/os/bsd/attachListener_bsd.cpp line 260:
>
>> 258: // name ("load", "datadump", ...), and <arg> is an argument
>> 259: int expected_str_count = 2 + AttachOperation::arg_count_max;
>> 260: const int max_len = (ver_str_len + 1) + (AttachOperation::name_length_max + 1) +
>
> This makes `max_len` a runtime variable, before it was a compile time constant. Below, we use it to create the buf array. IIRC creating an array with a variable runtime length is a non-standard compiler extension. I am surprised this even builds.
better to keep sizeof(ver_str) here (const)
-------------
PR: https://git.openjdk.org/jdk/pull/11115
More information about the hotspot-dev
mailing list