RFR: 8354941: Build failure with glibc 2.42 due to uabs() name collision

Kim Barrett kbarrett at openjdk.org
Tue Apr 29 01:47:57 UTC 2025


On Mon, 28 Apr 2025 08:36:56 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:

> As per the guide, [namespaces are discouraged](https://github.com/openjdk/jdk/blob/master/doc/hotspot-style.md#namespaces). So what would you suggest? Keep the macro and name-space the custom impl we have with something like `hotspot_uabs`? Something else? Sorry, it doesn't seem clear to me from the discussion.

Please don't use a macro for this.

"namespace" can also just mean a prefix. We already have some functions that
are "workalikes" for standard functions: `g_isnan`, `g_isfinite`. It might be
there used to be more. It's not a beautiful naming convention, but it's one
that already exists.

I think the use of uabs (under whatever name) for constant folding in the
compiler is a mistake. There should be java_abs for this. uabs returns the
wrong type for that purpose (it returns an unsigned value), and in the places
in the compiler where it is used there is an implicit conversion that will
need to be fixed if we ever try to turn on `-Wconversion`. This can be fixed
in a followup. Just renaming uabs everywhere to dodge the build failure is
fine for now.

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

PR Comment: https://git.openjdk.org/jdk/pull/24723#issuecomment-2837208418


More information about the hotspot-dev mailing list