Closed Indra-db closed 1 year ago
I'm not able to reproduce the issue using msvc 19.35. How did you build the code?
@SanderMertens just building with visual studio 19 flecs_bug.zip this is the repro solution
Made some new observations:
The bug persists on platform toolset v142 Microsoft Visual Studio Community 2019 Version 16.11.29 prints 549 680 810
does not persist on platform toolset v143 Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.4.4 prints 548 553 556
updated Visual studio Community 2019 Version 16.11.30, the bug still persists on there and on all language standards.
edit: compiler version on vs19: Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30152 for x86 using cmd cl I double checked this with std::cout << "Visual Studio Compiler Version: " << _MSC_VER << std::endl; and that reports 1929 too.
compiler version vs22: Microsoft (R) C/C++ Optimizing Compiler Version 19.34.31937 for x86
Fixed!
My Windows _MSC_VER= 1929, I found same bug. ( flecs version master)
if I changed enum.hpp code 1930 to 1929, the bug will fix.
so there need change 1930 to 1929?
@SanderMertens
Describe the bug Upon registering an enum constant using the MSVC compiler, 128 entities are registered irrespective of the actual field count within the enum. This was observable while utilizing a minimal code snippet, where only two enum fields were present but resulted in the registration of 128 entities.
To Reproduce
Expected behavior The expected outcome should be the registration of only two entities correlating to the enum fields: Walking and Running, rather than an arbitrary 128 entities.
Actual Behavior: The system registers 128 entities for each registered enum, yielding entity IDs 549 and 680 in this particular instance
Additional context
compiler: Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30151 for x64.
Observable both in Flecs 3.2.4 and 3.2.7. Other releases not tested.
This bug is also viewable on the explorer, showing that too many entities have been registered under the enum.