I use Visual C++ 2022, v143 toolset, compiler flag C++20.
When trying to compile my FCL code, I get the error "error C4146: unary minus operator applied to unsigned type, result still unsigned" in include\fcl\geometry\bvh\BVH_model-inl.h, line 884 (_bvnode->first_child = -((*cur_primitiveindices) + 1);)
Seems the calculation (dereferenced pointer + 1) results in an unsigned int type. Therefore the prefix '-' is an error for the compiler.
Adding an explicit cast (bvnode->first_child = -(static_cast\<int>(*cur_primitive_indices) + 1);) helps to solve the issue.
Hi,
I use Visual C++ 2022, v143 toolset, compiler flag C++20.
When trying to compile my FCL code, I get the error "error C4146: unary minus operator applied to unsigned type, result still unsigned" in include\fcl\geometry\bvh\BVH_model-inl.h, line 884 (_bvnode->first_child = -((*cur_primitiveindices) + 1);)
Seems the calculation (dereferenced pointer + 1) results in an unsigned int type. Therefore the prefix '-' is an error for the compiler.
Adding an explicit cast (bvnode->first_child = -(static_cast\<int>(*cur_primitive_indices) + 1);) helps to solve the issue.
Best regards