Jextract flattens nested anonymous structs and unions when computing layouts

XMLWordPrintable

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

      For layouts such as these:

          struct Foo {
              int x;
              union {
                  int y;
                  int z;
              };
          };

      Jextract will generate:

          static final MemoryLayout Foo$struct$LAYOUT_ = MemoryLayout.ofStruct(
              C_INT.withName("x"),
              C_INT.withName("y"),
              C_INT.withName("z")
          ).withName("Foo");

      We should change the layout generation to not flatten layouts of nested anonymous structs into their parents.

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

              Created:
              Updated:
              Resolved: