Integrated: 7903662: Javadoc generated by jextract breaks javac compilation

Maurizio Cimadamore mcimadamore at openjdk.org
Thu Feb 15 10:03:05 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).

This pull request has now been integrated.

Changeset: 7dfea195
Author:    Maurizio Cimadamore <mcimadamore at openjdk.org>
URL:       https://git.openjdk.org/jextract/commit/7dfea195715257290b55f9c8eb964ed002bcf53d
Stats:     1 line in 1 file changed: 0 ins; 0 del; 1 mod

7903662: Javadoc generated by jextract breaks javac compilation

Reviewed-by: jvernee

-------------

PR: https://git.openjdk.org/jextract/pull/209


More information about the jextract-dev mailing list