From df8489816b455f43c0fa31924306523fdf3e1898 Mon Sep 17 00:00:00 2001 From: Andreas Buhr Date: Wed, 14 Oct 2020 19:40:59 +0200 Subject: [PATCH] Fix compilation with optimization with g++-10.2 When compiling in RelWithDebInfo configuration with g++-10.2, it complains: qtbase/src/gui/painting/qdatabuffer_p.h:71:36: error: argument 1 range [18446744065119617024, 18446744073709551612] exceeds maximum object size 9223372036854775807 [-Werror=alloc-size-larger-than=] This patch disables this warning in this place. Pick-to: 5.15 Change-Id: Id3154ce80a1921671031828aaa7144214adad5dd Reviewed-by: Thiago Macieira Reviewed-by: Qt CI Bot --- src/gui/painting/qdatabuffer_p.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/painting/qdatabuffer_p.h b/src/gui/painting/qdatabuffer_p.h index 676750b716d..c3b8c0fd852 100644 --- a/src/gui/painting/qdatabuffer_p.h +++ b/src/gui/painting/qdatabuffer_p.h @@ -66,7 +66,10 @@ public: { capacity = res; if (res) { + QT_WARNING_PUSH + QT_WARNING_DISABLE_GCC("-Walloc-size-larger-than=") buffer = (Type*) malloc(capacity * sizeof(Type)); + QT_WARNING_POP Q_CHECK_PTR(buffer); } else { buffer = nullptr;