RFR: 7903615: Jextract should generate javadoc contents using libclang pretty printer [v3]

Maurizio Cimadamore mcimadamore at openjdk.org
Wed Jan 10 15:01:27 UTC 2024


On Wed, 10 Jan 2024 13:06:31 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix issue with comments in macro values
>
> src/main/java/org/openjdk/jextract/impl/TreeMaker.java line 241:
> 
>> 239:         } else if (Utils.isPointer(type)) {
>> 240:             // add pointer cast to make it look different from a numeric constant
>> 241:             valueString = STR."(\{valueString})";
> 
> Shouldn't this be something like:
> 
> 
> valueString = STR."({type}) {valueString}";
> 
> 
> It seems like the current code would result in things like this:
> 
>     #define FOO (42)

I've fixed this by adding a cast to `void*` always. Note that `type.toString` doesn't return something that is similar to the C decl, so we can't really use that. (whether that's something we want to fix is a question for another PR I think)

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

PR Review Comment: https://git.openjdk.org/jextract/pull/169#discussion_r1447502720


More information about the jextract-dev mailing list