Instead of using str_fmt this method should just print a space num_spaces times:
// returns a format string to print a julong with the given width. E.g,
// printf(num_fmt(6), julong(10)) would print out the number 10 with 4
// leading spaces.
PRAGMA_DIAG_PUSH
PRAGMA_FORMAT_NONLITERAL_IGNORED
static void print_julong(outputStream* st, int width, julong n) {
int num_spaces = width - julong_width(n);
if (num_spaces > 0) {
st->print(str_fmt(num_spaces), "");
}
st->print(JULONG_FORMAT, n);
}
PRAGMA_DIAG_POP
// returns a format string to print a julong with the given width. E.g,
// printf(num_fmt(6), julong(10)) would print out the number 10 with 4
// leading spaces.
PRAGMA_DIAG_PUSH
PRAGMA_FORMAT_NONLITERAL_IGNORED
static void print_julong(outputStream* st, int width, julong n) {
int num_spaces = width - julong_width(n);
if (num_spaces > 0) {
st->print(str_fmt(num_spaces), "");
}
st->print(JULONG_FORMAT, n);
}
PRAGMA_DIAG_POP
- duplicates
-
JDK-8139116 Fixes for warning "format not a string literal"
- Resolved