RFR: 7903662: Javadoc generated by jextract breaks javac compilation
Jorn Vernee
jvernee at openjdk.org
Wed Feb 14 23:16:02 UTC 2024
On Wed, 14 Feb 2024 22:14:04 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> We have recently switched to generate the source-like description of C API elements using the clang API, which allows for better fidelity with the original C code. While this works generally well, libclang has some strange behavior around anonymous structs, where some of them (not all!) are reported together with the path in which the declaration occurs.
>
> Since adding paths to the javadoc is generally a bad idea, which can lead to all sorts of troubles, jextract implements a basic filtering logic, which uses a regex to detect the overly verbose description strings. It turns out that, while the regex works well for libclang 13 and later, earlier versions have issues, as instead of using the term "unnamed struct" libclang uses "anonymous struct".
>
> Anyway, the fix is to tweak the regex we use to detect bogus descriptions to include "anonymous". This should make jextract a bit more robust w.r.t. changes across different libclang versions (and, I hope that this gets fixed upstream so that we don't have to apply such nasty workarounds).
Marked as reviewed by jvernee (Committer).
-------------
PR Review: https://git.openjdk.org/jextract/pull/209#pullrequestreview-1881475033
More information about the jextract-dev
mailing list