[PATCH 2/4] fix build errors with gcc6
Guido Trentalancia
guido at trentalancia.net
Wed May 11 15:26:43 UTC 2016
The following (RFC) patch aims to fix the following build error
with gcc6:
/home/guido/new/jdk8u60/mercurial-rep/jdk8u60/hotspot/src/os/linux/vm/os_linux.cpp: In static member function ‘static void* os::dll_load(const char*, char*, int)’:
/home/guido/new/jdk8u60/mercurial-rep/jdk8u60/hotspot/src/os/linux/vm/os_linux.cpp:1939:66: warning: narrowing conversion of ‘elf_head.Elf32_Ehdr::e_ident[4]’ from ‘unsigned char’ to ‘char’ inside { } [-Wnarrowing]
arch_t lib_arch={elf_head.e_machine,0,elf_head.e_ident[EI_CLASS], elf_head.e_ident[EI_DATA], NULL};
~~~~~~~~~~~~~~~~~~~~~~~~~^
/home/guido/new/jdk8u60/mercurial-rep/jdk8u60/hotspot/src/os/linux/vm/os_linux.cpp:1939:93: warning: narrowing conversion of ‘elf_head.Elf32_Ehdr::e_ident[5]’ from ‘unsigned char’ to ‘char’ inside { } [-Wnarrowing]
arch_t lib_arch={elf_head.e_machine,0,elf_head.e_ident[EI_CLASS], elf_head.e_ident[EI_DATA], NULL};
~~~~~~~~~~~~~~~~~~~~~~~~^
/home/guido/new/jdk8u60/mercurial-rep/jdk8u60/hotspot/src/os/posix/vm/os_posix.cpp: In static member function ‘static const char* os::Posix::describe_sa_flags(int, char*, size_t)’:
/home/guido/new/jdk8u60/mercurial-rep/jdk8u60/hotspot/src/os/posix/vm/os_posix.cpp:612:3: error: narrowing conversion of ‘2147483648u’ from ‘unsigned int’ to ‘int’ inside { } [-Wnarrowing]
};
^
Signed-off-by: Guido Trentalancia <guido at trentalancia.net>
---
hotspot/src/os/posix/vm/os_posix.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- jdk8u/hotspot/src/os/posix/vm/os_posix.cpp.orig 2016-05-11 00:43:47.586130518 +0200
+++ jdk8u/hotspot/src/os/posix/vm/os_posix.cpp 2016-05-11 00:29:51.359779693 +0200
@@ -594,7 +594,7 @@ const char* os::Posix::describe_sa_flags
strncpy(buffer, "none", size);
const struct {
- int i;
+ unsigned int i;
const char* s;
} flaginfo [] = {
{ SA_NOCLDSTOP, "SA_NOCLDSTOP" },
@@ -612,7 +612,7 @@ const char* os::Posix::describe_sa_flags
};
for (idx = 0; flaginfo[idx].s && remaining > 1; idx++) {
- if (flags & flaginfo[idx].i) {
+ if (((unsigned int) flags) & flaginfo[idx].i) {
if (first) {
jio_snprintf(p, remaining, "%s", flaginfo[idx].s);
first = false;
More information about the jdk8u-dev
mailing list