RFR (trivial): 8235819: -Wformat-overflow is reported from GCC 9

Yasumasa Suenaga suenaga at oss.nttdata.com
Mon Dec 16 10:12:04 UTC 2019


Also we can use macro to resolve this issue:

   http://hg.openjdk.java.net/jdk/submit/rev/219fdca61e3a

I prefer to use dynamic allocation and format string because it is more secure.
This change makes not so large. It passed tests on submit repo (mach5-one-ysuenaga-JDK-8235819-3-20191216-0731-7570580).


Thanks,

Yasumasa


On 2019/12/15 15:08, Yasumasa Suenaga wrote:
> Hi Thomas, Leo,
> 
> How about this change?
> 
>    http://hg.openjdk.java.net/jdk/submit/rev/10816e67561a
> 
> It generates indent string via alloca().
> So get_indent() should be inlined.
> 
> However it was failed at TestGCLogMessages on macOS only on submit repo (mach5-one-ysuenaga-JDK-8235819-1-20191215-0359-7545712).
> 
> If you are generally ok to this change, could you share details of this failure?
> I will fix it.
> 
> 
> Thanks,
> 
> Yasumasa
> 
> 
> On 2019/12/14 4:28, Thomas Schatzl wrote:
>> Hi,
>>
>> On 13.12.19 15:42, Yasumasa Suenaga wrote:
>>> Hi Leo,
>>>
>>> Thanks for clarifying.
>>> I continue to wait Reviewer for webrev.00 .
>>>
>>>>>>>    webrev: http://cr.openjdk.java.net/~ysuenaga/JDK-8235819/webrev.00/
>>>
>>
>>    I would prefer to implement Leo's suggestion.
>>
>> Looking at the code, the warning is a false positive, as in actual execution the index never goes to 5 (e.g. YoungFreeCSet does not have sub-items afaict), and the _work_items != NULL check prevents it from being an actual issue.
>>
>> I am open to making GCC happy by extending the array *if* the manual check/assert does not help, which gcc very likely does not recognize, too.
>>
>> Thanks,
>>    Thomas



More information about the hotspot-gc-dev mailing list