Skip to content

Commit

Permalink
8308288: Fix xlc17 clang warnings and build errors in hotspot
Browse files Browse the repository at this point in the history
Reviewed-by: goetz, mbaesken
  • Loading branch information
JoKern65 authored and TheRealMDoerr committed Jun 7, 2023
1 parent 89f5bac commit 5b147eb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/hotspot/share/runtime/os.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ char* os::iso8601_time(jlong milliseconds_since_19700101, char* buffer, size_t b
// No offset when dealing with UTC
time_t UTC_to_local = 0;
if (!utc) {
#if defined(_ALLBSD_SOURCE) || defined(_GNU_SOURCE)
#if (defined(_ALLBSD_SOURCE) || defined(_GNU_SOURCE)) && !defined(AIX)
UTC_to_local = -(time_struct.tm_gmtoff);
#elif defined(_WINDOWS)
long zone;
Expand Down Expand Up @@ -878,8 +878,8 @@ bool os::print_function_and_library_name(outputStream* st,
// this as a function descriptor for the reader (see below).
if (!have_function_name && os::is_readable_pointer(addr)) {
address addr2 = (address)os::resolve_function_descriptor(addr);
if (have_function_name = is_function_descriptor =
dll_address_to_function_name(addr2, p, buflen, &offset, demangle)) {
if ((have_function_name = is_function_descriptor =
dll_address_to_function_name(addr2, p, buflen, &offset, demangle))) {
addr = addr2;
}
}
Expand Down
10 changes: 10 additions & 0 deletions src/hotspot/share/utilities/globalDefinitions_xlc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,22 @@
// globally used constants & types, class (forward)
// declarations and a few frequently used utility functions.

#include <alloca.h>
#include <ctype.h>
#include <string.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
// In stdlib.h on AIX malloc is defined as a macro causing
// compiler errors when resolving them in different depths as it
// happens in the log tags. This avoids the macro.
#if (defined(__VEC__) || defined(__AIXVEC)) && defined(AIX) \
&& defined(__open_xl_version__) && __open_xl_version__ >= 17
#undef malloc
extern void *malloc(size_t) asm("vec_malloc");
#endif

#include <wchar.h>

#include <math.h>
Expand Down

1 comment on commit 5b147eb

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.