RFR: 8354941: Build failure with GCC 15 due to uabs() name collision

Severin Gehwolf sgehwolf at openjdk.org
Thu Apr 17 12:37:23 UTC 2025


GCC 15 defines its own version of `uabs` when `stdlib.h` is being included. I propose to rename the hotspot version of `uabs` to `custom_uabs` (or some other suitable name) to avoid the name clash. The rename of the function is hidden by using a `UABS` macro instead in the code.

Testing:
- [ ] GHA
- [x] Builds with this patch with GCC 15 where the build would fail earlier and pass with this patch.

Thoughts?

-------------

Commit messages:
 - 8354941: Build failure with GCC 15 due to uabs() name collision

Changes: https://git.openjdk.org/jdk/pull/24723/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24723&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8354941
  Stats: 20 lines in 9 files changed: 4 ins; 0 del; 16 mod
  Patch: https://git.openjdk.org/jdk/pull/24723.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24723/head:pull/24723

PR: https://git.openjdk.org/jdk/pull/24723


More information about the hotspot-dev mailing list