Bug:
Bindgen infers the type of 0xFFull << 60 incorrectly as s64.
Steps to repro:
- The repo already contains manually fixed bindings with which the program works.
- Run
jai generate.jaito run it and see it work. - Go to
generate.jaiand uncomment out the section for generating bindings. - Run
jai generate.jaiand see it fail on
Error: In a constant-expression cast, the bounds check failed. Number must be in [0, 4294967295], but it was 0xfffffffff0000000.
flecs_iter_cache_all :: 255;
ECS_MAX_COMPONENT_ID :: ~(cast(u32) (ECS_ID_FLAGS_MASK >> 32));
This is incorrect, because ECS_ID_FLAGS_MASK is a 0xFFull << 60
- Go to
flecs.hand on line 31867 add an explicit(uint64_t)cast, this makes bindgen do the right thing. - Re-run
jai generateto see the error fixed. Now there will be new errors with undefinedva_list. Manually commenting out all of these bindings (there's only 10 or so) fixes the problem, after which the program runs.