I’m getting compilation errors with the new gcc-13
<code>error: 'void* __builtin_memcpy(void*, const void*, long unsigned int)' reading between 16 and 1020 bytes from a region of size 0 [-Werror=stringop-overread]
243 | destMat[ind][ind2] = sourceMat[ind][ind2];
</code>
<code>error: 'void* __builtin_memcpy(void*, const void*, long unsigned int)' reading between 16 and 1020 bytes from a region of size 0 [-Werror=stringop-overread]
243 | destMat[ind][ind2] = sourceMat[ind][ind2];
</code>
error: 'void* __builtin_memcpy(void*, const void*, long unsigned int)' reading between 16 and 1020 bytes from a region of size 0 [-Werror=stringop-overread]
243 | destMat[ind][ind2] = sourceMat[ind][ind2];
this is the code I’m attempting to compile
<code> PxMat33 invD = D.getInverse();
for (PxU32 ind = 0; ind < nbJointDofs; ++ind)
{
for (PxU32 ind2 = 0; ind2 < nbJointDofs; ++ind2)
{
linkInvStISW.invStIs[ind][ind2] = invD[ind][ind2];
}
}
</code>
<code> PxMat33 invD = D.getInverse();
for (PxU32 ind = 0; ind < nbJointDofs; ++ind)
{
for (PxU32 ind2 = 0; ind2 < nbJointDofs; ++ind2)
{
linkInvStISW.invStIs[ind][ind2] = invD[ind][ind2];
}
}
</code>
PxMat33 invD = D.getInverse();
for (PxU32 ind = 0; ind < nbJointDofs; ++ind)
{
for (PxU32 ind2 = 0; ind2 < nbJointDofs; ++ind2)
{
linkInvStISW.invStIs[ind][ind2] = invD[ind][ind2];
}
}
Taken from physx
I think this code is safe since I verified that nbJointDofs
can only be set at 6 at max, but the compiler likely can’t verify it.
Is there any way I can tell the compiler that the max value here can only be 6?
3