# HG changeset patch # User ysuenaga # Date 1557505038 -32400 # Node ID 03570d8cebe038fc4f95acd73466400b15bf9051 # Parent b316aa340b90c4608cd67f96cfaa46041306ee90 8223186: HotSpot compile warnings from GCC 9 Reviewed-by: dholmes, aeubanks, sgehwolf diff -r b316aa340b90 -r 03570d8cebe0 src/os/linux/vm/osContainer_linux.cpp --- a/src/os/linux/vm/osContainer_linux.cpp Wed Jan 20 01:23:14 2021 +0000 +++ b/src/os/linux/vm/osContainer_linux.cpp Sat May 11 01:17:18 2019 +0900 @@ -495,7 +495,7 @@ } if (memory->is_hierarchical()) { const char* matchline = "hierarchical_memory_limit"; - char* format = "%s " JULONG_FORMAT; + const char* format = "%s " JULONG_FORMAT; GET_CONTAINER_INFO_LINE(julong, memory, "/memory.stat", matchline, "Hierarchical Memory Limit is: " JULONG_FORMAT, format, hier_memlimit) if (hier_memlimit >= _unlimited_memory) { @@ -522,7 +522,7 @@ } if (memory->is_hierarchical()) { const char* matchline = "hierarchical_memsw_limit"; - char* format = "%s " JULONG_FORMAT; + const char* format = "%s " JULONG_FORMAT; GET_CONTAINER_INFO_LINE(julong, memory, "/memory.stat", matchline, "Hierarchical Memory and Swap Limit is : " JULONG_FORMAT, format, hier_memlimit) if (hier_memlimit >= _unlimited_memory) { diff -r b316aa340b90 -r 03570d8cebe0 src/share/vm/prims/jvmtiExport.hpp --- a/src/share/vm/prims/jvmtiExport.hpp Wed Jan 20 01:23:14 2021 +0000 +++ b/src/share/vm/prims/jvmtiExport.hpp Sat May 11 01:17:18 2019 +0900 @@ -389,7 +389,7 @@ public: JvmtiCodeBlobDesc(const char *name, address code_begin, address code_end) { assert(name != NULL, "all code blobs must be named"); - strncpy(_name, name, sizeof(_name)); + strncpy(_name, name, sizeof(_name) - 1); _name[sizeof(_name)-1] = '\0'; _code_begin = code_begin; _code_end = code_end;