jextract and bit fields

Rémy Maucherat remm at apache.org
Mon Jan 30 13:25:57 UTC 2023


Hi,

When processing certain bit-fields, jextract produces an error:
"Invalid bitSize: 1"
In addition to not being really helpful (it took me some time to find
out what the problem was since no reference to a location is given,
nor that this is about a bit-field).

A typical example causing the error is something like:
struct my_struct {
   unsigned int foo : 1;
};

Obviously we don't have these sort of memory saving "smart" fancy
tricks in Java (which is probably good since they can cause serious
problems when misused ...).

Is support for this planned eventually, or should bit-fields be
avoided for Panama compatibility ?

Thanks !

Rémy


More information about the jextract-dev mailing list