RFR: 7903674: jextract should ignore non-enum constants inside enum [v2]

Maurizio Cimadamore mcimadamore at openjdk.org
Tue Feb 20 12:46:03 UTC 2024


On Tue, 20 Feb 2024 07:41:11 GMT, Athijegannathan Sundararajan <sundar at openjdk.org> wrote:

>> * checking cursor kind of child cursor to be CursorKind.EnumConstantDecl. 
>> * Piggybacking to fix similar check of record child element kinds to be CursorKind.FieldDecl.  
>> * Added null check for createTree return value in collectNestedTypes method as well.
>> * In addition to jextract tests, I ran all samples on Mac OS. All fine with this change. Also, ran jextract script for Mac OS from  https://github.com/manuelbl/JavaDoesUSB.git.
>
> Athijegannathan Sundararajan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   moved nested 'if' inside 'else' as 'else if'

I believe that at least test for something like this:


enum __attribute((deprecated)) Foo {
    CFByteOrderUnknown,
}; 


Should be added. Windows uses a different attribute syntax (`[[deprecated]]`). So either we use a macro to define the attribute, or we just test on Linux/Mac.

It might also be useful to add tests for:


struct __attribute((deprecated))  Foo {
   int x;
};


e.g. struct field case. And:


typedef __attribute((deprecated)) struct  { int x } BAR;


For the nested struct case.

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

PR Comment: https://git.openjdk.org/jextract/pull/221#issuecomment-1954137356


More information about the jextract-dev mailing list