build: add missing GCC condition for pragma

This commit is contained in:
Alexander Alekhin 2022-07-24 12:19:37 +03:00
parent db53f4533e
commit 85b0b0cd77

View File

@ -829,14 +829,19 @@ else // CV_8U
v_pack_store(dst + k, __pack01);
}
#endif
#if defined(__GNUC__) && __GNUC__ >= 9
// avoid warning "iteration 7 invokes undefined behavior" on Linux ARM64
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Waggressive-loop-optimizations"
#endif
for( ; k < len; k++ )
{
dst[k] = saturate_cast<uchar>(rawDst[k]*nrm2);
}
#if defined(__GNUC__) && __GNUC__ >= 9
#pragma GCC diagnostic pop
#endif
}
#else
float* dst = dstMat.ptr<float>(row);