RFR: 8299635: More test issues for deprecated sprintf in Xcode 14

Xue-Lei Andrew Fan xuelei at openjdk.org
Fri Jan 13 08:45:16 UTC 2023


On Thu, 12 Jan 2023 07:25:07 GMT, Xue-Lei Andrew Fan <xuelei at openjdk.org> wrote:

>>> This PR does not address all the remaining sprintf:s in hotspot, and with it now explicitly forbidden the build will fail:
>>> 
>> 
>> This is a question to me as well.  I noticed there are still some use of sprintf, but the building passed on MacOS and Linux.  I was wondering if the following update really work (if the '...' parameter works for the forbidden?), or something else matters.
>> 
>> 
>> FORBID_C_FUNCTION(int sprintf(char*, const char*, ...), "use os::snprintf");
>> 
>> 
>>> I count ~30 sprintf:s that need updating.
>>> 
>>> I'm also curious: some of the sprintfs are C2 (src/hotspot/share/opto) - are your builds including C2? If so, why are you not running into the issue for those files?
>> 
>> I'm new to hotspot.  Do you know how could I enable C2?  Thanks!
>
>> > I'm also curious: some of the sprintfs are C2 (src/hotspot/share/opto) - are your builds including C2? If so, why are you not running into the issue for those files?
>> 
>> I'm new to hotspot. Do you know how could I enable C2? Thanks!
> 
> Never mind, I got it from configuration help message (use --with-jvm-features=compiler2).

> @XueleiFan Could you, please, do not integrate until more cases with the same problem are fixed?

Sure. That's on my plan.  I am trying to figure out how to get these files included in the building.  My build passed on MacOS and Linux, even with C2 enabled.

The update on test may be different from src update.  I may divide the fix into two PRs, if I figure out how to build the missing uses of sprintf:s.

Thank for for the feedback.  I appreciated it.

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

PR: https://git.openjdk.org/jdk/pull/11935


More information about the serviceability-dev mailing list