Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address Compiler Warnings when building on AIX with OpenXL #7583

Open
midronij opened this issue Dec 4, 2024 · 0 comments
Open

Address Compiler Warnings when building on AIX with OpenXL #7583

midronij opened this issue Dec 4, 2024 · 0 comments

Comments

@midronij
Copy link
Contributor

midronij commented Dec 4, 2024

When building on AIX with OpenXL, the build will fail due a large number of unused variable/function errors such as the following:

/home/midronij/openj9-openjdk-jdk21/omr/port/aix/omrosbacktrace_impl.c:103:8: error: unused variable 'r1' [-Werror,-Wunused-variable]
  103 |         void *r1;
      |               ^~
/home/midronij/openj9-openjdk-jdk21/omr/port/aix/omrosbacktrace_impl.c:180:12: error: unused variable 'count' [-Werror,-Wunused-variable]
  180 |         uintptr_t count;
      |                   ^~~~~
2 errors generated.

To work around this, the -Werror flag will temporarily be omitted for builds done with OpenXL:

if(NOT CMAKE_C_COMPILER_IS_OPENXL)
	set(OMR_C_WARNINGS_AS_ERROR_FLAG -Werror)
	set(OMR_CXX_WARNINGS_AS_ERROR_FLAG -Werror)
	set(OMR_NASM_WARNINGS_AS_ERROR_FLAG -Werror)
endif()

(from cmake/modules/platform/toolcfg/gnu.cmake).

However, to remain consistent with the flags currently being used to build on AIX with xlC, these warnings/errors should be addressed so that the -Werror flag can be used without the build failing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants