Skip to content

Commit e7c5bf4

Browse files
committed
8341722: Fix some warnings as errors when building on Linux with toolchain clang
Reviewed-by: cjplummer, lucy
1 parent 36fca5d commit e7c5bf4

File tree

5 files changed

+4
-11
lines changed

5 files changed

+4
-11
lines changed

make/modules/jdk.hotspot.agent/Lib.gmk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBSAPROC, \
5959
OPTIMIZATION := HIGH, \
6060
EXTRA_HEADER_DIRS := java.base:libjvm, \
6161
DISABLED_WARNINGS_gcc := sign-compare, \
62-
DISABLED_WARNINGS_gcc_LinuxDebuggerLocal.cpp := unused-variable, \
6362
DISABLED_WARNINGS_gcc_ps_core.c := pointer-arith, \
64-
DISABLED_WARNINGS_gcc_symtab.c := unused-but-set-variable, \
6563
DISABLED_WARNINGS_clang := sign-compare, \
6664
DISABLED_WARNINGS_clang_libproc_impl.c := format-nonliteral, \
6765
DISABLED_WARNINGS_clang_MacosxDebuggerLocal.m := unused-variable, \

src/jdk.hotspot.agent/linux/native/libsaproc/LinuxDebuggerLocal.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,6 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo
420420
jboolean isCopy;
421421
jlongArray array;
422422
jlong *regs;
423-
int i;
424423

425424
struct ps_prochandle* ph = get_proc_handle(env, this_obj);
426425
if (get_lwp_regs(ph, lwp_id, &gregs) != true) {

src/jdk.hotspot.agent/linux/native/libsaproc/symtab.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,6 @@ static struct symtab* build_symtab_internal(int fd, const char *filename, bool t
356356

357357
if (shdr->sh_type == sym_section) {
358358
ELF_SYM *syms;
359-
int rslt;
360359
size_t size, n, j, htab_sz;
361360

362361
// FIXME: there could be multiple data buffers associated with the
@@ -390,7 +389,8 @@ static struct symtab* build_symtab_internal(int fd, const char *filename, bool t
390389
goto bad;
391390
}
392391

393-
rslt = hcreate_r(htab_sz, symtab->hash_table);
392+
// int rslt =
393+
hcreate_r(htab_sz, symtab->hash_table);
394394
// guarantee(rslt, "unexpected failure: hcreate_r");
395395

396396
// shdr->sh_link points to the section that contains the actual strings

src/jdk.jpackage/share/native/common/Log.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ namespace {
4040
// variables are initialized if any. This will result in AV. To avoid such
4141
// use cases keep logging module free from static variables that require
4242
// initialization with functions called by CRT.
43-
//
44-
45-
// by default log everything
46-
const Logger::LogLevel defaultLogLevel = Logger::LOG_TRACE;
4743

4844
char defaultLogAppenderMemory[sizeof(StreamLogAppender)] = {};
4945

test/hotspot/gtest/runtime/test_os_linux.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,10 @@ TEST_VM(os_linux, pretouch_thp_and_use_concurrent) {
360360
EXPECT_TRUE(os::commit_memory(heap, size, false));
361361

362362
{
363-
auto pretouch = [heap, size](Thread*, int) {
363+
auto pretouch = [heap](Thread*, int) {
364364
os::pretouch_memory(heap, heap + size, os::vm_page_size());
365365
};
366-
auto useMemory = [heap, size](Thread*, int) {
366+
auto useMemory = [heap](Thread*, int) {
367367
int* iptr = reinterpret_cast<int*>(heap);
368368
for (int i = 0; i < 1000; i++) *iptr++ = i;
369369
};

0 commit comments

Comments
 (0)