You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes the compiler doesn't seem to be able to infer that a QueryFilter's mNodeCount is lesser or equal than MaxCursorCount, this results in a compiler warning, and therefore a compiler error.
Reproduce
Steps to reproduce the behavior:
Clone the repo
cmake -S. -Bbuild -D CMAKE_CXX_COMPILER=c++
cmake --build build -j 12
Expected behaviour
No compiler error.
Screenshots
[ 26%] Building CXX object core/CMakeFiles/cubos-core.dir/src/ecs/query/filter.cpp.o
cd /home/user/Documents/gamedev/cubos/build/core && /usr/bin/c++ -DCPPTRACE_DEMANGLE_WITH_CXXABI -DCPPTRACE_GET_SYMBOLS_WITH_LIBDWARF -DCPPTRACE_HAS_CXX_EXCEPTION_TYPE -DCPPTRACE_HAS_DL_FIND_OBJECT -DCPPTRACE_STATIC_DEFINE -DCPPTRACE_UNWIND_WITH_UNWIND -DCUBOS_CORE_ECS_MAX_COMPONENTS=63 -DCUBOS_CORE_EXPORT -DCUBOS_CORE_IMPORT -DCUBOS_METRIC_MAX_ENTRIES=1024 -DCUBOS_PROFILING=ON -DGLAD_GLAPI_EXPORT -DGLAD_GLAPI_EXPORT_BUILD -DGLM_FORCE_SILENT_WARNINGS -DWITH_GLFW -DWITH_OPENGL -Dcubos_core_EXPORTS -I/home/user/Documents/gamedev/cubos/core/include -I/home/user/Documents/gamedev/cubos/core/lib/glad/include -I/home/user/Documents/gamedev/cubos/core/lib/glfw/include -I/home/user/Documents/gamedev/cubos/core/lib/stduuid/include -I/home/user/Documents/gamedev/cubos/core/lib/stduuid -I/home/user/Documents/gamedev/cubos/core/lib/json/include -isystem /home/user/Documents/gamedev/cubos/core/lib/cpptrace/include -isystem /home/user/Documents/gamedev/cubos/build/core/lib/cpptrace/include -isystem /home/user/Documents/gamedev/cubos/core/lib/miniaudio -isystem /home/user/Documents/gamedev/cubos/core/lib/glm/glm/.. -O3 -DNDEBUG -std=gnu++20 -fPIC -Wall -Wextra -pedantic -Wconversion -Werror -Wno-attributes -Wno-maybe-uninitialized -MD -MT core/CMakeFiles/cubos-core.dir/src/ecs/query/filter.cpp.o -MF CMakeFiles/cubos-core.dir/src/ecs/query/filter.cpp.o.d -o CMakeFiles/cubos-core.dir/src/ecs/query/filter.cpp.o -c /home/user/Documents/gamedev/cubos/core/src/ecs/query/filter.cpp
/home/user/Documents/gamedev/cubos/core/src/ecs/query/filter.cpp: In member function ‘void cubos::core::ecs::QueryFilter::update()’:
/home/user/Documents/gamedev/cubos/core/src/ecs/query/filter.cpp:139:22: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
139 | mNodePins[i] = mNodePins[i - 1] | mNodes[i - 1]->pins();
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/user/Documents/gamedev/cubos/core/src/ecs/query/filter.cpp:3:
/home/user/Documents/gamedev/cubos/core/include/cubos/core/ecs/query/filter.hpp:66:31: note: at offset 8 into destination object ‘cubos::core::ecs::QueryFilter::mNodePins’ of size 8
66 | QueryNode::TargetMask mNodePins[QueryNode::MaxCursorCount];
| ^~~~~~~~~
cc1plus: all warnings being treated as errors
The text was updated successfully, but these errors were encountered:
This is kind of weird, if i open the project in vscode it will prompt me to choose a compiler, and after choosing g++ it will compile without any error, but if i use the flag -D CMAKE_CXX_COMPILER=g++ it will not...
c++ looks like a symbolic link to g++ so I don't know why this is happening.
Description
Sometimes the compiler doesn't seem to be able to infer that a QueryFilter's mNodeCount is lesser or equal than MaxCursorCount, this results in a compiler warning, and therefore a compiler error.
Reproduce
Steps to reproduce the behavior:
cmake -S. -Bbuild -D CMAKE_CXX_COMPILER=c++
cmake --build build -j 12
Expected behaviour
No compiler error.
Screenshots
The text was updated successfully, but these errors were encountered: