From dd0647b17aa43bccf36285285ecccb54f18176ad Mon Sep 17 00:00:00 2001 From: Andreas Buhr Date: Wed, 14 Oct 2020 19:48:30 +0200 Subject: [PATCH] Fix to make g++-10.2 happy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit g++-10.2 fails to compile qregion.cpp in RelWithDebInfo configuration, with error message: qregion.cpp:3617:12: error: ‘ET.EdgeTable::ymax’ may be used uninitialized in this function [-Werror=maybe-uninitialized] g++ is right here, for Count==1, 'ET' is not initialized but used. This patch fixes this by Q_ASSUMEing Count > 1. Pick-to: 5.15 Change-Id: I3b9f1f58de9f3811c60640a08334487e3f8f2b23 Reviewed-by: Andrei Golubev Reviewed-by: Fabian Kosmale --- src/gui/painting/qregion.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp index 7acfceee8d5..df1f2575fe7 100644 --- a/src/gui/painting/qregion.cpp +++ b/src/gui/painting/qregion.cpp @@ -3572,6 +3572,8 @@ static QRegionPrivate *PolygonRegion(const QPoint *Pts, int Count, int rule) POINTBLOCK *tmpPtBlock; int numFullPtBlocks = 0; + Q_ASSUME(Count > 1); + region = new QRegionPrivate; /* special case a rectangle */