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

Jextract doesn't honor pack pragmas

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: repo-panama
    • Fix Version/s: None
    • Component/s: tools

      Description

      C programs can have less strict alignment constraints using pragmas directives:

      #pragma pack(4)

      struct packed_struct {
              int x;
              long long y;
              long long z;
      }

      Currently, jextract ignores these directives, and ends up generating layouts which feature standard alignment constraint. In the above case, this would lead to issues, since "y" is not 64-bit aligned. That is, jextract needs to tweak the alignment constraint associated with the struct layout, to make sure that the layout is well formed w.r.t. alignment constraints.

      Original problem reported here:
      https://mail.openjdk.java.net/pipermail/panama-dev/2021-January/011820.html

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sundar Sundararajan Athijegannathan
              Reporter:
              mcimadamore Maurizio Cimadamore
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: