SanderMertens / flecs

A fast entity component system (ECS) for C & C++
https://www.flecs.dev
Other
6.46k stars 454 forks source link

uninitialized static data #1361

Closed Indra-db closed 1 month ago

Indra-db commented 1 month ago

for the units addon, all types are defined as ECS_DECLARE(EcsCenti) which translated to ecs_entity_t EcsCenti, FLECS_IDEcsCentiID_;

when importing units module with FlecsUnitsImport , you only set EcsCenti variable, and FLECS_IDEcsCentiID_ remains 0 initialized.

these statics are also duplicated due to it, and for example exposed twice when generating bindings for it

image

Up to you how you would like to solve this, either by removing the FLECS_IDxxxID_ variant or setting Ecsx = FLECS_IDxxxID_

Indra-db commented 1 month ago

Hm. I should have filed this as a bug instead, instead of a blank issue. My first thought was "this isn't really a bug bug" , but on second thought, it is

SanderMertens commented 1 month ago

Fixed!