RFR: 7903776: jextract generates uncompilable code when C identifier with the name from "java.lang" classes is used
Athijegannathan Sundararajan
sundar at openjdk.org
Wed Jul 17 06:34:03 UTC 2024
On Tue, 16 Jul 2024 13:52:49 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> Unqualified names are mangled by NameMangler. But it was complete (didn't include "Boolean"). For uniformity & future proof mangling all type names from "java.lang" package.
>
> src/main/java/org/openjdk/jextract/impl/NameMangler.java line 329:
>
>> 327: // Java types that are used unqualified in the generated code
>> 328: return switch (name) {
>> 329: case "String", "Struct", "MethodHandle",
>
> should `String` be dropped from this list? Also, there seem to be other names that are out of sync, such as `NativeArena` and `Struct` (I wonder if we just want to repeat your trick for `java.lang.foreign`) and some are missing (e.g. `MethodHandle` but not `VarHandle` ?)
VarHandle and MethodHandle both are already included. Perhaps we can do same trick for java.lang.foreign.
-------------
PR Review Comment: https://git.openjdk.org/jextract/pull/253#discussion_r1680485484
More information about the jextract-dev
mailing list