Details
-
Bug
-
Resolution: Fixed
-
P4
-
8, 11, 13
-
b21
-
linux
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8260712 | 11.0.12-oracle | Dukebot | P4 | Resolved | Fixed | b01 |
JDK-8260055 | 11.0.11 | Yasumasa Suenaga | P4 | Resolved | Fixed | b01 |
JDK-8260157 | openjdk8u292 | Yasumasa Suenaga | P4 | Resolved | Fixed | b01 |
Description
I saw following warnings when I compiled HotSpot with GCC 9 on Fedora 30:
/home/ysuenaga/OpenJDK/jdk/src/hotspot/os/linux/osContainer_linux.cpp: In static member function 'static jlong OSContainer::memory_limit_in_bytes()':
/home/ysuenaga/OpenJDK/jdk/src/hotspot/os/linux/osContainer_linux.cpp:470:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
470 | char* format = "%s " JULONG_FORMAT;
/home/ysuenaga/OpenJDK/jdk/src/hotspot/os/linux/osContainer_linux.cpp: In static member function 'static jlong OSContainer::memory_and_swap_limit_in_bytes()':
/home/ysuenaga/OpenJDK/jdk/src/hotspot/os/linux/osContainer_linux.cpp:493:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
493 | char* format = "%s " JULONG_FORMAT;
/home/ysuenaga/OpenJDK/jdk/src/hotspot/share/gc/shared/ptrQueue.cpp: In constructor 'BufferNode::Allocator::Allocator(const char*, size_t)':
/home/ysuenaga/OpenJDK/jdk/src/hotspot/share/gc/shared/ptrQueue.cpp:97:10: warning: 'char* strncpy(char*, const char*, size_t)' specified bound 120 equals destination size [-Wstringop-truncation]
97 | strncpy(_name, name, sizeof(_name));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ysuenaga/OpenJDK/jdk/src/hotspot/share/compiler/disassembler.cpp: In constructor 'decode_env::decode_env(CodeBlob*, outputStream*, CodeStrings, ptrdiff_t)':
/home/ysuenaga/OpenJDK/jdk/src/hotspot/share/compiler/disassembler.cpp:365:32: warning: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'class decode_env'; use assignment instead [-Wclass-memaccess]
365 | memset(this, 0, sizeof(*this)); // Beware, this zeroes bits of fields.
| ^
/home/ysuenaga/OpenJDK/jdk/src/hotspot/share/compiler/disassembler.cpp:153:7: note: 'class decode_env' declared here
153 | class decode_env {
| ^~~~~~~~~~
In file included from /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/runtime/thread.hpp:34,
from /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/runtime/safepoint.hpp:30,
from /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/gc/shared/collectedHeap.hpp:33,
from /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/precompiled/precompiled.hpp:37:
In constructor 'JvmtiCodeBlobDesc::JvmtiCodeBlobDesc(const char*, address, address)',
inlined from 'static void CodeBlobCollector::do_blob(CodeBlob*)' at /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/prims/jvmtiCodeBlobEvents.cpp:141:94:
/home/ysuenaga/OpenJDK/jdk/src/hotspot/share/prims/jvmtiExport.hpp:423:12: warning: 'char* strncpy(char*, const char*, size_t)' specified bound 64 equals destination size [-Wstringop-truncation]
423 | strncpy(_name, name, sizeof(_name));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In constructor 'JvmtiCodeBlobDesc::JvmtiCodeBlobDesc(const char*, address, address)',
inlined from 'void CodeBlobCollector::collect()' at /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/prims/jvmtiCodeBlobEvents.cpp:177:94:
/home/ysuenaga/OpenJDK/jdk/src/hotspot/share/prims/jvmtiExport.hpp:423:12: warning: 'char* strncpy(char*, const char*, size_t)' specified bound 64 equals destination size [-Wstringop-truncation]
423 | strncpy(_name, name, sizeof(_name));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/runtime/thread.hpp:34,
from /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/runtime/safepoint.hpp:30,
from /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/gc/shared/collectedHeap.hpp:33,
from /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/precompiled/precompiled.hpp:37:
In constructor 'JvmtiCodeBlobDesc::JvmtiCodeBlobDesc(const char*, address, address)',
inlined from 'void JvmtiDynamicCodeEventCollector::register_stub(const char*, address, address)' at /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/prims/jvmtiExport.cpp:2825:60:
/home/ysuenaga/OpenJDK/jdk/src/hotspot/share/prims/jvmtiExport.hpp:423:12: warning: 'char* strncpy(char*, const char*, size_t)' specified bound 64 equals destination size [-Wstringop-truncation]
423 | strncpy(_name, name, sizeof(_name));
|
/home/ysuenaga/OpenJDK/jdk/src/hotspot/os/linux/osContainer_linux.cpp: In static member function 'static jlong OSContainer::memory_limit_in_bytes()':
/home/ysuenaga/OpenJDK/jdk/src/hotspot/os/linux/osContainer_linux.cpp:470:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
470 | char* format = "%s " JULONG_FORMAT;
/home/ysuenaga/OpenJDK/jdk/src/hotspot/os/linux/osContainer_linux.cpp: In static member function 'static jlong OSContainer::memory_and_swap_limit_in_bytes()':
/home/ysuenaga/OpenJDK/jdk/src/hotspot/os/linux/osContainer_linux.cpp:493:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
493 | char* format = "%s " JULONG_FORMAT;
/home/ysuenaga/OpenJDK/jdk/src/hotspot/share/gc/shared/ptrQueue.cpp: In constructor 'BufferNode::Allocator::Allocator(const char*, size_t)':
/home/ysuenaga/OpenJDK/jdk/src/hotspot/share/gc/shared/ptrQueue.cpp:97:10: warning: 'char* strncpy(char*, const char*, size_t)' specified bound 120 equals destination size [-Wstringop-truncation]
97 | strncpy(_name, name, sizeof(_name));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ysuenaga/OpenJDK/jdk/src/hotspot/share/compiler/disassembler.cpp: In constructor 'decode_env::decode_env(CodeBlob*, outputStream*, CodeStrings, ptrdiff_t)':
/home/ysuenaga/OpenJDK/jdk/src/hotspot/share/compiler/disassembler.cpp:365:32: warning: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'class decode_env'; use assignment instead [-Wclass-memaccess]
365 | memset(this, 0, sizeof(*this)); // Beware, this zeroes bits of fields.
| ^
/home/ysuenaga/OpenJDK/jdk/src/hotspot/share/compiler/disassembler.cpp:153:7: note: 'class decode_env' declared here
153 | class decode_env {
| ^~~~~~~~~~
In file included from /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/runtime/thread.hpp:34,
from /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/runtime/safepoint.hpp:30,
from /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/gc/shared/collectedHeap.hpp:33,
from /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/precompiled/precompiled.hpp:37:
In constructor 'JvmtiCodeBlobDesc::JvmtiCodeBlobDesc(const char*, address, address)',
inlined from 'static void CodeBlobCollector::do_blob(CodeBlob*)' at /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/prims/jvmtiCodeBlobEvents.cpp:141:94:
/home/ysuenaga/OpenJDK/jdk/src/hotspot/share/prims/jvmtiExport.hpp:423:12: warning: 'char* strncpy(char*, const char*, size_t)' specified bound 64 equals destination size [-Wstringop-truncation]
423 | strncpy(_name, name, sizeof(_name));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In constructor 'JvmtiCodeBlobDesc::JvmtiCodeBlobDesc(const char*, address, address)',
inlined from 'void CodeBlobCollector::collect()' at /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/prims/jvmtiCodeBlobEvents.cpp:177:94:
/home/ysuenaga/OpenJDK/jdk/src/hotspot/share/prims/jvmtiExport.hpp:423:12: warning: 'char* strncpy(char*, const char*, size_t)' specified bound 64 equals destination size [-Wstringop-truncation]
423 | strncpy(_name, name, sizeof(_name));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/runtime/thread.hpp:34,
from /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/runtime/safepoint.hpp:30,
from /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/gc/shared/collectedHeap.hpp:33,
from /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/precompiled/precompiled.hpp:37:
In constructor 'JvmtiCodeBlobDesc::JvmtiCodeBlobDesc(const char*, address, address)',
inlined from 'void JvmtiDynamicCodeEventCollector::register_stub(const char*, address, address)' at /home/ysuenaga/OpenJDK/jdk/src/hotspot/share/prims/jvmtiExport.cpp:2825:60:
/home/ysuenaga/OpenJDK/jdk/src/hotspot/share/prims/jvmtiExport.hpp:423:12: warning: 'char* strncpy(char*, const char*, size_t)' specified bound 64 equals destination size [-Wstringop-truncation]
423 | strncpy(_name, name, sizeof(_name));
|
Attachments
Issue Links
- backported by
-
JDK-8260055 HotSpot compile warnings from GCC 9
- Resolved
-
JDK-8260157 HotSpot compile warnings from GCC 9
- Resolved
-
JDK-8260712 HotSpot compile warnings from GCC 9
- Resolved
- duplicates
-
JDK-8223668 Clang Linux build broken
- Closed
- relates to
-
JDK-8223810 HotSpot compile warnings from VS2017
- Resolved
-
JDK-8223668 Clang Linux build broken
- Closed
-
JDK-8232187 Add os::strncpy_s
- Open
(2 relates to)