8311575: Fix invalid format parameters

Reviewed-by: dholmes, kbarrett, mli
This commit is contained in:
Daniel Jeliński 2023-07-07 12:14:16 +00:00
parent 9084b6c9d5
commit 34004e1666
3 changed files with 12 additions and 12 deletions

View File

@ -222,7 +222,7 @@ static bool is_directory_secure(const char* path) {
else {
// unexpected error, declare the path insecure
if (PrintMiscellaneous && Verbose) {
warning("could not get attributes for file %s: ",
warning("could not get attributes for file %s: "
" lasterror = %d\n", path, lasterror);
}
return false;

View File

@ -1153,13 +1153,13 @@ char *ADLParser::parse_one_arg(const char *description) {
}
next_char(); // skip the close paren
if(_curchar != ';') { // check for semi-colon
parse_err(SYNERR, "missing %c in.\n", ';', description);
parse_err(SYNERR, "missing %c in %s.\n", ';', description);
return nullptr;
}
next_char(); // skip the semi-colon
}
else {
parse_err(SYNERR, "Missing %c in.\n", '(', description);
parse_err(SYNERR, "Missing %c in %s.\n", '(', description);
return nullptr;
}
@ -4191,7 +4191,7 @@ ExpandRule* ADLParser::expand_parse(InstructForm *instr) {
if (_curchar == '%') { // Need a constructor for the operand
c = find_cpp_block("Operand Constructor");
if (c == nullptr) {
parse_err(SYNERR, "Invalid code block for operand constructor\n", _curchar);
parse_err(SYNERR, "Invalid code block for operand constructor\n");
continue;
}
// Add constructor to _newopconst Dict

View File

@ -1148,7 +1148,7 @@ bool Arguments::process_argument(const char* arg,
JVMFlag* fuzzy_matched = JVMFlag::fuzzy_match((const char*)argname, arg_len, true);
if (fuzzy_matched != nullptr) {
jio_fprintf(defaultStream::error_stream(),
"Did you mean '%s%s%s'? ",
"Did you mean '%s%s%s'?\n",
(fuzzy_matched->is_bool()) ? "(+/-)" : "",
fuzzy_matched->name(),
(fuzzy_matched->is_bool()) ? "" : "=<value>");
@ -1913,7 +1913,7 @@ bool Arguments::check_vm_args_consistency() {
if (UseHeavyMonitors) {
if (FLAG_IS_CMDLINE(LockingMode) && LockingMode != LM_MONITOR) {
jio_fprintf(defaultStream::error_stream(),
"Conflicting -XX:+UseHeavyMonitors and -XX:LockingMode=%d flags", LockingMode);
"Conflicting -XX:+UseHeavyMonitors and -XX:LockingMode=%d flags\n", LockingMode);
return false;
}
FLAG_SET_CMDLINE(LockingMode, LM_MONITOR);
@ -1922,21 +1922,21 @@ bool Arguments::check_vm_args_consistency() {
#if !defined(X86) && !defined(AARCH64) && !defined(PPC64) && !defined(RISCV64) && !defined(S390)
if (LockingMode == LM_MONITOR) {
jio_fprintf(defaultStream::error_stream(),
"LockingMode == 0 (LM_MONITOR) is not fully implemented on this architecture");
"LockingMode == 0 (LM_MONITOR) is not fully implemented on this architecture\n");
return false;
}
#endif
#if defined(X86) && !defined(ZERO)
if (LockingMode == LM_MONITOR && UseRTMForStackLocks) {
jio_fprintf(defaultStream::error_stream(),
"LockingMode == 0 (LM_MONITOR) and -XX:+UseRTMForStackLocks are mutually exclusive");
"LockingMode == 0 (LM_MONITOR) and -XX:+UseRTMForStackLocks are mutually exclusive\n");
return false;
}
#endif
if (VerifyHeavyMonitors && LockingMode != LM_MONITOR) {
jio_fprintf(defaultStream::error_stream(),
"-XX:+VerifyHeavyMonitors requires LockingMode == 0 (LM_MONITOR)");
"-XX:+VerifyHeavyMonitors requires LockingMode == 0 (LM_MONITOR)\n");
return false;
}
return status;
@ -2838,7 +2838,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* patch_m
if (jvmci_compiler != nullptr) {
if (strncmp(jvmci_compiler, "graal", strlen("graal")) != 0) {
jio_fprintf(defaultStream::error_stream(),
"Value of jvmci.Compiler incompatible with +UseGraalJIT: %s", jvmci_compiler);
"Value of jvmci.Compiler incompatible with +UseGraalJIT: %s\n", jvmci_compiler);
return JNI_ERR;
}
} else if (!add_property("jvmci.Compiler=graal")) {
@ -2855,7 +2855,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* patch_m
if (jvmciFlag != nullptr && jvmciFlag->is_unlocked()) {
if (!JVMCIGlobals::enable_jvmci_product_mode(origin, use_graal_jit)) {
jio_fprintf(defaultStream::error_stream(),
"Unable to enable JVMCI in product mode");
"Unable to enable JVMCI in product mode\n");
return JNI_ERR;
}
}
@ -3948,7 +3948,7 @@ jint Arguments::parse(const JavaVMInitArgs* initial_cmd_args) {
const NMT_TrackingLevel lvl = NMTUtil::parse_tracking_level(NativeMemoryTracking);
if (lvl == NMT_unknown) {
jio_fprintf(defaultStream::error_stream(),
"Syntax error, expecting -XX:NativeMemoryTracking=[off|summary|detail]", nullptr);
"Syntax error, expecting -XX:NativeMemoryTracking=[off|summary|detail]\n");
return JNI_ERR;
}
if (PrintNMTStatistics && lvl == NMT_off) {