Warnings in JExtract generated code

Jorn Vernee jorn.vernee at oracle.com
Mon Jun 3 12:02:23 UTC 2024


Hello Martin,

We generate all the imports up front, before we know which ones will be 
needed in the file. We could probably cut down on some of them depending 
on the type of class being generated (e.g. struct vs. header file), but 
completely removing all unused imports would take a lot of effort. We 
essentially build up a source file from a series of source code 
snippets, so we'd have to manually track the imports that each snippet 
uses. I'm not sure if it's worth the effort just to get rid of the 
unused imports, tbh. My feeling is that, because we are mechanically 
generating code, even if we removed the unused imports, there will 
always be /some/ oddities in the generated sources that you won't find 
in hand-written code (which might trigger warnings).

I think Christoph has some good suggestions for workarounds, 
particularly putting the generated sources in a separate folder with a 
different warning profile.

Jorn

On 2-6-2024 21:27, Martin Pernollet wrote:
> Hi,
>
> There are lot of unused imports in JExtract generated code leading to 
> lot of warnings.
>
> That would be nice to get rid of them : PanamaGL has +100.000 warnings 
> in the bindings part :)
>
> image.png
>
>
> image.png
>
> Regards,
>
> Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20240603/6245c0b5/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 60203 bytes
Desc: not available
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20240603/6245c0b5/image-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 109922 bytes
Desc: not available
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20240603/6245c0b5/image-0003.png>


More information about the panama-dev mailing list