prototypeless function representation
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Mon Jul 15 10:19:16 UTC 2024
Hi,
I don't think jextract should paper over what seem like bugs in header
files (even if common ones) ?
I think a possible workaround for dealing with such libraries is to pass
clang the `-x c++` flag. This can be done as described here:
https://github.com/openjdk/jextract/blob/master/doc/GUIDE.md#additional-clang-options
Cheers
Maurizio
On 15/07/2024 08:08, Stephen Buergler wrote:
> Hello!
> I think most of the time there is something like
> extern void RcloneInitialize();
> is put into a header file it's meant to declare a function with no
> parameters.
> jextract outputs variadic versions of the binding though because
> that's not what that means. It means that the function declaration has
> no prototype and has an unknown number of parameters.
> extern void RcloneInitialize(void);
> This defines a function with no parameters and is what is usually
> intended and with this version the jextract bindings now reflect that
> there are no parameters to pass in.
>
> Would it make sense to change jextract to be able to treat these as
> functions that take no parameters?
> Alternatively, would it make sense to provide bindings for both
> versions of the function?
> If a `public static void RcloneInitialize()` and the variadic version
> existed I think that would make sense.
>
More information about the jextract-dev
mailing list