From: Markus Böck Date: Tue, 27 Oct 2020 13:53:08 +0000 (-0400) Subject: analyzer: Change cast from long to intptr_t [PR96608] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=942086bf73ee2ba6cfd7fdacc552940048437a6e;p=gcc.git analyzer: Change cast from long to intptr_t [PR96608] Casting to intptr_t states the intent of an integer to pointer cast more clearly and ensures that the cast causes no loss of precision on any platforms. LLP64 platforms eg. have a long value of 4 bytes and pointer values of 8 bytes which may even cause compiler errors. gcc/analyzer/ChangeLog: PR analyzer/96608 * store.h (hash): Cast to intptr_t instead of long --- diff --git a/gcc/analyzer/store.h b/gcc/analyzer/store.h index 466c1830c0f..8054b34d9da 100644 --- a/gcc/analyzer/store.h +++ b/gcc/analyzer/store.h @@ -271,7 +271,7 @@ public: hashval_t hash () const { - return (binding_key::impl_hash () ^ (long)m_region); + return (binding_key::impl_hash () ^ (intptr_t)m_region); } bool operator== (const symbolic_binding &other) const {