<div dir="ltr"><div>I guess so but prototypeless functions seem to work fine with other tools including when they are brought into C++ builds.</div><div>Also right now if someone does go back and fix the header files it will result in large breaking changes to the generated jextract bindings.</div><div><br></div>Neat but this flag seems to cause other issues.<div>FATAL: Unexpected exception org.openjdk.jextract.clang.Index$ParsingFailedException: Failed to parse ...\librclone.h: ASTReadError occurred<br></div><div>It's not a very helpful error message.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 15, 2024 at 5:19 AM Maurizio Cimadamore <<a href="mailto:maurizio.cimadamore@oracle.com">maurizio.cimadamore@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
I don't think jextract should paper over what seem like bugs in header <br>
files (even if common ones) ?<br>
<br>
I think a possible workaround for dealing with such libraries is to pass <br>
clang the `-x c++` flag. This can be done as described here:<br>
<br>
<a href="https://github.com/openjdk/jextract/blob/master/doc/GUIDE.md#additional-clang-options" rel="noreferrer" target="_blank">https://github.com/openjdk/jextract/blob/master/doc/GUIDE.md#additional-clang-options</a><br>
<br>
Cheers<br>
Maurizio<br>
<br>
On 15/07/2024 08:08, Stephen Buergler wrote:<br>
> Hello!<br>
> I think most of the time there is something like<br>
> extern void RcloneInitialize();<br>
> is put into a header file it's meant to declare a function with no <br>
> parameters.<br>
> jextract outputs variadic versions of the binding though because <br>
> that's not what that means. It means that the function declaration has <br>
> no prototype and has an unknown number of parameters.<br>
> extern void RcloneInitialize(void);<br>
> This defines a function with no parameters and is what is usually <br>
> intended and with this version the jextract bindings now reflect that <br>
> there are no parameters to pass in.<br>
><br>
> Would it make sense to change jextract to be able to treat these as <br>
> functions that take no parameters?<br>
> Alternatively, would it make sense to provide bindings for both <br>
> versions of the function?<br>
> If a `public static void RcloneInitialize()` and the variadic version <br>
> existed I think that would make sense.<br>
><br>
</blockquote></div>