From: Timur Kristóf Date: Tue, 21 Jan 2020 12:43:13 +0000 (+0100) Subject: aco: Fix -Wstringop-overflow warnings in aco_span. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6fb3df2786f09f4c7383cb0a15d394316d240c42;p=mesa.git aco: Fix -Wstringop-overflow warnings in aco_span. 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: --- 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