RFR [XS] : hotspot/share/opto/parse2.cpp compile error with gcc 7.3.1
Thomas Stüfe
thomas.stuefe at gmail.com
Wed Oct 10 12:46:03 UTC 2018
Hi Matthias,
could you please use jio_snprintf, and also specify sizeof(buffer)
instead of literally re-specifying the buffer size?
Thanks! Thomas
On Tue, Oct 9, 2018 at 3:51 PM Baesken, Matthias
<matthias.baesken at sap.com> wrote:
>
> Hello, please review this gcc 7 related build fix .
>
>
> When building on Linux with gcc 7.3.1 I run into this compile error :
>
> /open_jdk/jdk_just_clone/jdk/src/hotspot/share/opto/parse2.cpp:1349:14: note: 'sprintf' output 2 or more bytes (assuming 2147488583) into a destination of size 30
> sprintf(prob_str_buf, "%g", prob);
> ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
> cc1plus: all warnings being treated as errors
>
>
> The issue is that we print a floating point number into a fixed size buffer for output .
>
> I adjusted the coding a bit :
>
> http://cr.openjdk.java.net/~mbaesken/webrevs/8211929.0/
>
> https://bugs.openjdk.java.net/browse/JDK-8211929
>
>
>
> Best regards, Matthias
More information about the hotspot-dev
mailing list