RFR: JDK-8326974: ODR violation in macroAssembler_aarch64.cpp

Andrew Haley aph at openjdk.org
Thu Feb 29 15:43:43 UTC 2024


On Thu, 29 Feb 2024 13:27:59 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

> > I think the patch suggested in bug was better, and in line with [Hotspot Style Guide](https://github.com/openjdk/jdk/blob/master/doc/hotspot-style.md), which says: "Global names must be unique, to avoid [One Definition Rule](https://en.cppreference.com/w/cpp/language/definition) (ODR) violations. A common prefixing scheme for related global names is often used. (This is instead of using namespaces, which are mostly avoided in HotSpot.)"
> 
> See also the section "Namespaces", and in particular the specific admonition against using anonymous namespaces.

Mmm, that's a shame. It seems to me that an anonymous namespace is best here, given that the classes should not be visible outside this translation unit, but implementation bugs in debuggers and linkers are a show stopper.

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

PR Comment: https://git.openjdk.org/jdk/pull/18056#issuecomment-1971410464


More information about the hotspot-dev mailing list