QTesselator: disable for-loop analysis on Clang

Caught by Clang 4:
error: variable 'k' is incremented both in the loop header and in the loop body [-Werror,-Wfor-loop-analysis]

But we don't want to change behavior unless we can prove that it's wrong
or that there's a way to refactor this without changing it.

Change-Id: Iecee112b0cd96bec8d975430a74ca548ee2f470f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This commit is contained in:
Shawn Rutledge 2017-05-29 13:28:37 +02:00
parent ab8ea993b3
commit c379719607

View File

@ -755,6 +755,8 @@ void QTessellatorPrivate::cancelCoincidingEdges()
std::sort(tl, tl + testListSize);
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wfor-loop-analysis")
for (int j = 0; j < testListSize; ++j) {
if (tl[j].used)
continue;
@ -773,6 +775,7 @@ void QTessellatorPrivate::cancelCoincidingEdges()
}
++j;
}
QT_WARNING_POP
}
free(tl);
}