[PATCH] Mere code changes to silence some warnings (original) (raw)

David CARLIER devnexen at gmail.com
Thu Nov 30 17:06:04 UTC 2017


Hi dear list,

Here a tiny patch to address few compilation warnings, two concerns UB with define e.g #define A it is usually better this form #if #define A 1 ... Few types comparison miusmatches as well.

Hope is all good ... tested full build. -------------- next part -------------- diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp @@ -2153,7 +2153,7 @@ } p = OSContainer::cpu_cpuset_memory_nodes(); - if (p < 0) + if (!p) st->print("cpu_memory_nodes() failed\n"); else { st->print("cpu_memory_nodes: %s\n", p); diff --git a/src/hotspot/share/gc/g1/heapRegionSet.hpp b/src/hotspot/share/gc/g1/heapRegionSet.hpp --- a/src/hotspot/share/gc/g1/heapRegionSet.hpp +++ b/src/hotspot/share/gc/g1/heapRegionSet.hpp @@ -50,7 +50,11 @@ // HEAP_REGION_SET_FORCE_VERIFY to be 1, or in builds in which // asserts are compiled in. #ifndef HEAP_REGION_SET_FORCE_VERIFY -#define HEAP_REGION_SET_FORCE_VERIFY defined(ASSERT) +#if defined(ASSERT) +#define HEAP_REGION_SET_FORCE_VERIFY 1 +#else +#define HEAP_REGION_SET_FORCE_VERIFY 0 +#endif #endif // HEAP_REGION_SET_FORCE_VERIFY class HRSMtSafeChecker : public CHeapObj { diff --git a/src/hotspot/share/oops/accessBackend.cpp b/src/hotspot/share/oops/accessBackend.cpp --- a/src/hotspot/share/oops/accessBackend.cpp +++ b/src/hotspot/share/oops/accessBackend.cpp @@ -172,18 +172,3 @@ Copy::conjoint_jlongs_atomic(src, dst, length); } }

-template void AccessInternal::arraycopy_conjoint(jbyte* src, jbyte* dst, size_t length); -template void AccessInternal::arraycopy_conjoint(jshort* src, jshort* dst, size_t length); -template void AccessInternal::arraycopy_conjoint(jint* src, jint* dst, size_t length); -template void AccessInternal::arraycopy_conjoint(jlong* src, jlong* dst, size_t length);

-template void AccessInternal::arraycopy_arrayof_conjoint(jbyte* src, jbyte* dst, size_t length); -template void AccessInternal::arraycopy_arrayof_conjoint(jshort* src, jshort* dst, size_t length); -template void AccessInternal::arraycopy_arrayof_conjoint(jint* src, jint* dst, size_t length); -template void AccessInternal::arraycopy_arrayof_conjoint(jlong* src, jlong* dst, size_t length);

-template void AccessInternal::arraycopy_conjoint_atomic(jbyte* src, jbyte* dst, size_t length); -template void AccessInternal::arraycopy_conjoint_atomic(jshort* src, jshort* dst, size_t length); -template void AccessInternal::arraycopy_conjoint_atomic(jint* src, jint* dst, size_t length); -template void AccessInternal::arraycopy_conjoint_atomic(jlong* src, jlong* dst, size_t length); diff --git a/src/hotspot/share/utilities/nativeCallStack.cpp b/src/hotspot/share/utilities/nativeCallStack.cpp --- a/src/hotspot/share/utilities/nativeCallStack.cpp +++ b/src/hotspot/share/utilities/nativeCallStack.cpp @@ -37,7 +37,11 @@ // to call os::get_native_stack. A tail call is used if NMT_NOINLINE is not defined // (which means this is not a slowdebug build), and we are on 64-bit (except Windows). // This is not necessarily a rule, but what has been obvserved to date. -#define TAIL_CALL (!defined(NMT_NOINLINE) && !defined(WINDOWS) && defined(_LP64)) +#if (!defined(NMT_NOINLINE) && !defined(WINDOWS) && defined(_LP64)) +#define TAIL_CALL 1 +#else +#define TAIL_CALL 0 +#endif #if !TAIL_CALL toSkip++; #if (defined(NMT_NOINLINE) && defined(BSD) && defined(_LP64)) diff --git a/src/java.base/share/native/libfdlibm/e_sqrt.c b/src/java.base/share/native/libfdlibm/e_sqrt.c --- a/src/java.base/share/native/libfdlibm/e_sqrt.c +++ b/src/java.base/share/native/libfdlibm/e_sqrt.c @@ -171,7 +171,7 @@ t = s0; if((t<ix0)||((t==ix0)&&(t1<=ix1))) { s1 = t1+r;

diff --git a/src/java.base/share/native/libfdlibm/s_ceil.c b/src/java.base/share/native/libfdlibm/s_ceil.c --- a/src/java.base/share/native/libfdlibm/s_ceil.c +++ b/src/java.base/share/native/libfdlibm/s_ceil.c @@ -77,7 +77,7 @@ if(j0==20) i0+=1; else { j = i1 + (1<<(52-j0));

diff --git a/src/java.base/share/native/libfdlibm/s_floor.c b/src/java.base/share/native/libfdlibm/s_floor.c --- a/src/java.base/share/native/libfdlibm/s_floor.c +++ b/src/java.base/share/native/libfdlibm/s_floor.c @@ -78,7 +78,7 @@ if(j0==20) i0+=1; else { j = i1+(1<<(52-j0));

diff --git a/src/java.base/share/native/libfdlibm/s_log1p.c b/src/java.base/share/native/libfdlibm/s_log1p.c --- a/src/java.base/share/native/libfdlibm/s_log1p.c +++ b/src/java.base/share/native/libfdlibm/s_log1p.c @@ -128,7 +128,7 @@ * Added redundant test against hx to work around VC++ * code generation problem. */



More information about the jdk-dev mailing list