Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8225552

typedef can interfere with primitive classes

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: repo-panama
    • Fix Version/s: None
    • Component/s: tools
    • Labels:

      Description

      jextract can fail if a C header file have a typedef that collides with the java.lang classes on a primitive type.

      For example, with following C header,

      typedef char Byte;
      void func(Byte byte, Byte* out);

      jextract would spit out a function like following,

      public void func(byte byte$, Pointer<Byte> out);

      and an annotation class for typedef,

      public static @interface Byte {}

      This will cause compilation errors on the static-forwarder or user code.

      The immediate thought would be trying to use --exclude-symbol to filter out Byte, but that doesn't work because symbol filter doesn't apply to typedef.

        Attachments

          Activity

            People

            Assignee:
            henryjen Henry Jen
            Reporter:
            henryjen Henry Jen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: