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

jextract can't handle multiple extern declarations that have the same name, but a different type name

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: repo-panama
    • Fix Version/s: None
    • Component/s: tools

      Description

      For the following header:

          typedef int MyInt;

          extern const int x;
          extern const MyInt x;

      Extracting results in errors like:

          java.lang.RuntimeException: In memory compilation failed: warning: using incubating module(s): jdk.incubator.foreign
          org/jextract/test_h.java:29: error: method x$LAYOUT() is already defined in class test_h
              public static MemoryLayout x$LAYOUT() {
                                                           ^

      Note that if chaning MyInt to int for the second declaration makes it work.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jvernee Jorn Vernee
              Reporter:
              jvernee Jorn Vernee
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: