RFR [XS] : hotspot/share/opto/parse2.cpp compile error with gcc 7.3.1

Baesken, Matthias matthias.baesken at sap.com
Tue Oct 9 13:51:19 UTC 2018


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