Skip to content

Commit

Permalink
8311575: Fix invalid format parameters
Browse files Browse the repository at this point in the history
Reviewed-by: dholmes, kbarrett, mli
  • Loading branch information
djelinski committed Jul 7, 2023
1 parent 9084b6c commit 34004e1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/hotspot/os/windows/perfMemory_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/share/adlc/adlparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions src/hotspot/share/runtime/arguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>");
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -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")) {
Expand All @@ -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;
}
}
Expand Down Expand Up @@ -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) {
Expand Down

1 comment on commit 34004e1

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.