RFR: 7903777: jextract layout for enum with big constant values is wrong [v2]
Jorn Vernee
jvernee at openjdk.org
Tue Jul 16 14:06:07 UTC 2024
On Tue, 16 Jul 2024 13:59:32 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> This PR fixes the code that generates enum layouts. Currently, the layout of an enum type is determined by looking at the type of the first enum constant.
>> In some platforms, this strategy does not work, as an enum can have constants of **different** types.
>>
>> The solution is to ask clang what the integral type of the enum declaration is, and store that as an attribute in the enum declaration. Then, we should simply retrieve that type when generating layouts that depend on the enum.
>>
>> I've added a platform-dependent test, since this functionality is only really available on Linux/gcc (on Windows, enum constants are all truncated to 32 bits, it seems).
>
> Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
>
> Use import
Marked as reviewed by jvernee (Committer).
test/jtreg/generator/bigEnum/bigEnum.h line 1:
> 1: typedef enum
Needs a copyright header?
-------------
PR Review: https://git.openjdk.org/jextract/pull/252#pullrequestreview-2180355413
PR Review Comment: https://git.openjdk.org/jextract/pull/252#discussion_r1679467072
More information about the jextract-dev
mailing list