RFR (trivial): 8235819: -Wformat-overflow is reported from GCC 9
leo.korinth at oracle.com
Thu Dec 12 14:26:26 UTC 2019
Your fix looks good to me (I am not a reviewer). Thanks for fixing this!
In the long run, I believe a better solution would be two have a
separate function for doing the indentation so that one could use format
strings to make the indentation level work for any level or, at least,
assert on over-run. This is a good fix for now however.
On 12/12/2019 13:51, Yasumasa Suenaga wrote:
> Hi all,
> Please review this trivial change:
> JBS: https://bugs.openjdk.java.net/browse/JDK-8235819
> webrev: http://cr.openjdk.java.net/~ysuenaga/JDK-8235819/webrev.00/
> I saw format-overflow warnings in g1GCPhaseTimes.cpp when I built
> jdk/jdk with GCC 9 on Fedora 31 as below:
> error: '%s' directive argument is null [-Werror=format-overflow=]
> 319 | out->print("%s", Indents[indent + 1]);
> | ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
> Indents seems to be insufficient.
> We need to give enough entries to it.
> This patch passed all tests on submit repo
More information about the hotspot-gc-dev