RFR(S): 8036122: Fix warning 'format not a string literal'

Lindenmaier, Goetz goetz.lindenmaier at sap.com
Mon Mar 3 05:22:05 PST 2014


Hi,

Since "8030350: Enable additional compiler warnings for GCC", the hotspot build issues warnings:

src/share/vm/compiler/compilerOracle.cpp: In function 'bool scan_line(const char*, char*, MethodMatcher::Mode*, char*, MethodMatcher::Mode*, int*, const char*&)':
src/share/vm/compiler/compilerOracle.cpp:425: warning: format not a string literal, argument types not checked
src/os/linux/vm/os_linux.cpp: In function 'jlong slow_thread_cpu_time(Thread*, bool)':
src/os/linux/vm/os_linux.cpp:5316: warning: format not a string literal, argument types not checked

Also, older gccs (4.2.2 and before) can not build hotspot any more. They don't know the option introduced in that change:

cc1plus: error: unrecognized command line option "-Wno-error=format-nonliteral"

This change fixes both by

-         Fixing the warning in the hotspot code

-         removing the flag from the makefiles.

Thus, the build with new gcc does no more issue warnings, and the build with older ones works again.

Please review and test this change - and I please need a sponsor.

http://cr.openjdk.java.net/~goetz/webrevs/8036122-1-fmtWrn/

Best regards,

  Goetz.











More information about the hotspot-dev mailing list