From 6fb3df2786f09f4c7383cb0a15d394316d240c42 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timur=20Krist=C3=B3f?= Date: Tue, 21 Jan 2020 13:43:13 +0100 Subject: [PATCH] aco: Fix -Wstringop-overflow warnings in aco_span. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit GCC does not understand how aco_span works. This patch fixes it by casting the aco_span's this pointer to uintptr_t rather than to a char pointer, effectively telling GCC not to try to figure it out. Signed-off-by: Timur Kristóf Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/amd/compiler/aco_util.h b/src/amd/compiler/aco_util.h index 8d4c4d390f0..b04eaba55a1 100644 --- a/src/amd/compiler/aco_util.h +++ b/src/amd/compiler/aco_util.h @@ -65,14 +65,14 @@ public: * \return data */ constexpr iterator begin() noexcept { - return (pointer)((char*)this + offset); + return (pointer)((uintptr_t)this + offset); } /*! \brief Returns a const_iterator to the begin of the span * \return data */ constexpr const_iterator begin() const noexcept { - return (const_pointer)((const char *)this + offset); + return (const_pointer)((uintptr_t)this + offset); } /*! \brief Returns an iterator to the end of the span -- 2.30.2