-
Enhancement
-
Resolution: Fixed
-
P4
-
12
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8215001 | 12 | Dmitry Chuyko | P4 | Resolved | Fixed | b24 |
src/hotspot/share/classfile/classLoader.cpp: In static member function ‘static const char* ClassLoader::file_name_for_class_name(const char*, int)’:
src/hotspot/share/classfile/classLoader.cpp:1233:53: error: argument to ‘sizeof’ in ‘char* strncpy(char*, const char*, size_t)’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
strncpy(&file_name[class_name_len], class_suffix, sizeof(class_suffix));
^~~~~~~~~~~~~~~~~~~~
The code itself looks correct and it seems having variable for suffix length should be enough.
src/hotspot/share/classfile/classLoader.cpp:1233:53: error: argument to ‘sizeof’ in ‘char* strncpy(char*, const char*, size_t)’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
strncpy(&file_name[class_name_len], class_suffix, sizeof(class_suffix));
^~~~~~~~~~~~~~~~~~~~
The code itself looks correct and it seems having variable for suffix length should be enough.
- backported by
-
JDK-8215001 Prevent GCC 8 from reporting error in ClassLoader::file_name_for_class_name()
- Resolved
- relates to
-
JDK-8213153 Clean up GCC 8 errors
- Closed