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
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_primitive_indices) + 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
The text was updated successfully, but these errors were encountered:
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_primitive_indices) + 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
The text was updated successfully, but these errors were encountered: