RFR (trivial): 8235819: -Wformat-overflow is reported from GCC 9
suenaga at oss.nttdata.com
Mon Dec 16 10:12:04 UTC 2019
Also we can use macro to resolve this issue:
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).
On 2019/12/15 15:08, Yasumasa Suenaga wrote:
> Hi Thomas, Leo,
> How about this change?
> 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.
> On 2019/12/14 4:28, Thomas Schatzl wrote:
>> 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.
More information about the hotspot-gc-dev