Skip to content

Commit

Permalink
8341722: Fix some warnings as errors when building on Linux with tool…
Browse files Browse the repository at this point in the history
…chain clang

Reviewed-by: cjplummer, lucy
  • Loading branch information
MBaesken committed Oct 10, 2024
1 parent 36fca5d commit e7c5bf4
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 11 deletions.
2 changes: 0 additions & 2 deletions make/modules/jdk.hotspot.agent/Lib.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBSAPROC, \
OPTIMIZATION := HIGH, \
EXTRA_HEADER_DIRS := java.base:libjvm, \
DISABLED_WARNINGS_gcc := sign-compare, \
DISABLED_WARNINGS_gcc_LinuxDebuggerLocal.cpp := unused-variable, \
DISABLED_WARNINGS_gcc_ps_core.c := pointer-arith, \
DISABLED_WARNINGS_gcc_symtab.c := unused-but-set-variable, \
DISABLED_WARNINGS_clang := sign-compare, \
DISABLED_WARNINGS_clang_libproc_impl.c := format-nonliteral, \
DISABLED_WARNINGS_clang_MacosxDebuggerLocal.m := unused-variable, \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,6 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo
jboolean isCopy;
jlongArray array;
jlong *regs;
int i;

struct ps_prochandle* ph = get_proc_handle(env, this_obj);
if (get_lwp_regs(ph, lwp_id, &gregs) != true) {
Expand Down
4 changes: 2 additions & 2 deletions src/jdk.hotspot.agent/linux/native/libsaproc/symtab.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ static struct symtab* build_symtab_internal(int fd, const char *filename, bool t

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

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

rslt = hcreate_r(htab_sz, symtab->hash_table);
// int rslt =
hcreate_r(htab_sz, symtab->hash_table);
// guarantee(rslt, "unexpected failure: hcreate_r");

// shdr->sh_link points to the section that contains the actual strings
Expand Down
4 changes: 0 additions & 4 deletions src/jdk.jpackage/share/native/common/Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ namespace {
// variables are initialized if any. This will result in AV. To avoid such
// use cases keep logging module free from static variables that require
// initialization with functions called by CRT.
//

// by default log everything
const Logger::LogLevel defaultLogLevel = Logger::LOG_TRACE;

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

Expand Down
4 changes: 2 additions & 2 deletions test/hotspot/gtest/runtime/test_os_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,10 @@ TEST_VM(os_linux, pretouch_thp_and_use_concurrent) {
EXPECT_TRUE(os::commit_memory(heap, size, false));

{
auto pretouch = [heap, size](Thread*, int) {
auto pretouch = [heap](Thread*, int) {
os::pretouch_memory(heap, heap + size, os::vm_page_size());
};
auto useMemory = [heap, size](Thread*, int) {
auto useMemory = [heap](Thread*, int) {
int* iptr = reinterpret_cast<int*>(heap);
for (int i = 0; i < 1000; i++) *iptr++ = i;
};
Expand Down

5 comments on commit e7c5bf4

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JesperIRL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/tag jdk-24+19

@openjdk
Copy link

@openjdk openjdk bot commented on e7c5bf4 Oct 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JesperIRL The tag jdk-24+19 was successfully created.

@MBaesken
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk23u

@openjdk
Copy link

@openjdk openjdk bot commented on e7c5bf4 Oct 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MBaesken Could not automatically backport e7c5bf45 to openjdk/jdk23u due to conflicts in the following files:

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

Please fetch the appropriate branch/commit and manually resolve these conflicts by using the following commands in your personal fork of openjdk/jdk23u. Note: these commands are just some suggestions and you can use other equivalent commands you know.

# Fetch the up-to-date version of the target branch
$ git fetch --no-tags https://git.openjdk.org/jdk23u.git master:master

# Check out the target branch and create your own branch to backport
$ git checkout master
$ git checkout -b backport-MBaesken-e7c5bf45-master

# Fetch the commit you want to backport
$ git fetch --no-tags https://git.openjdk.org/jdk.git e7c5bf45f753ad6459c666a4dd4a31197b69e05e

# Backport the commit
$ git cherry-pick --no-commit e7c5bf45f753ad6459c666a4dd4a31197b69e05e
# Resolve conflicts now

# Commit the files you have modified
$ git add files/with/resolved/conflicts
$ git commit -m 'Backport e7c5bf45f753ad6459c666a4dd4a31197b69e05e'

Once you have resolved the conflicts as explained above continue with creating a pull request towards the openjdk/jdk23u with the title Backport e7c5bf45f753ad6459c666a4dd4a31197b69e05e.

Below you can find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit e7c5bf45 from the openjdk/jdk repository.

The commit being backported was authored by Matthias Baesken on 10 Oct 2024 and was reviewed by Chris Plummer and Lutz Schmidt.

Thanks!

Please sign in to comment.