8199782: Fix compilation warnings detected by Solaris Developer Studio 12.6

Reviewed-by: sspitsyn, dholmes, ihse
This commit is contained in:
Gary Adams 2018-04-05 11:18:39 -07:00
parent b89ae10df2
commit 0ddec5ae89
4 changed files with 15 additions and 2 deletions

View File

@ -181,6 +181,11 @@ ifeq ($(OPENJDK_TARGET_OS), solaris)
else ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
JVM_CFLAGS += $(TOPDIR)/src/hotspot/os_cpu/solaris_sparc/solaris_sparc.il
endif
# Exclude warnings in devstudio 12.6
ifeq ($(CC_VERSION_NUMBER), 5.15)
DISABLED_WARNINGS_solstudio := SEC_ARR_OUTSIDE_BOUND_READ \
SEC_ARR_OUTSIDE_BOUND_WRITE
endif
endif
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), solaris-sparcv9)
@ -223,6 +228,7 @@ $(eval $(call SetupNativeCompilation, BUILD_LIBJVM, \
vm_version.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
arguments.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
DISABLED_WARNINGS_clang := tautological-compare, \
DISABLED_WARNINGS_solstudio := $(DISABLED_WARNINGS_solstudio), \
DISABLED_WARNINGS_xlc := 1540-0216 1540-0198 1540-1090 1540-1639 \
1540-1088 1500-010, \
ASFLAGS := $(JVM_ASFLAGS), \

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1393,6 +1393,7 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name,
bcp = (uintptr_t) regs[R_L1];
methodPtr = (uintptr_t) regs[R_L2];
sender_sp = regs[R_I5];
fp = (uintptr_t) regs[R_FP];
if (debug > 2) {
fprintf(stderr, "\nregs[R_I1]=%lx, regs[R_I2]=%lx, regs[R_I5]=%lx, regs[R_L1]=%lx, regs[R_L2]=%lx\n",
regs[R_I1], regs[R_I2], regs[R_I5], regs[R_L1], regs[R_L2]);

View File

@ -49,6 +49,9 @@
#include <ostream> // NOLINT
#include <sstream>
#include <vector>
#if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5140
#pragma error_messages(off, SEC_NULL_PTR_DEREF)
#endif
#if GTEST_OS_LINUX

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -26,6 +26,9 @@
#include <string.h>
#include <unistd.h>
#include <jni.h>
#if defined (__SUNPRO_C) && __SUNPRO_C >= 0x5140
#pragma error_messages(off, SEC_ARR_OUTSIDE_BOUND_READ)
#endif
#ifdef __cplusplus
extern "C" {