From: David Malcolm Date: Tue, 28 Jan 2020 21:31:01 +0000 (-0500) Subject: analyzer: fix build error with clang (PR 93543) X-Git-Tag: upstream/12.2.0~18598 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1dae549dccfec1edb0cb4e65feadc4722bb3bcc8;p=platform%2Fupstream%2Fgcc.git analyzer: fix build error with clang (PR 93543) https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=243681 reports a build failure with clang 9.0.1: gcc/analyzer/engine.cc:2971:13: error: reinterpret_cast from 'nullptr_t' to 'function *' is not allowed v.m_fun = reinterpret_cast (NULL); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ engine.cc:2983:21: error: reinterpret_cast from 'nullptr_t' to 'function *' is not allowed return v.m_fun == reinterpret_cast (NULL); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The casts appears to be unnecessary; eliminate them. gcc/analyzer/ChangeLog: PR analyzer/93543 * engine.cc (pod_hash_traits::mark_empty): Eliminate reinterpret_cast. (pod_hash_traits::is_empty): Likewise. --- diff --git a/gcc/analyzer/ChangeLog b/gcc/analyzer/ChangeLog index 4f0d014..8089280 100644 --- a/gcc/analyzer/ChangeLog +++ b/gcc/analyzer/ChangeLog @@ -1,3 +1,10 @@ +2020-02-04 David Malcolm + + PR analyzer/93543 + * engine.cc (pod_hash_traits::mark_empty): + Eliminate reinterpret_cast. + (pod_hash_traits::is_empty): Likewise. + 2020-02-03 David Malcolm * constraint-manager.cc (range::constrained_to_single_element): diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc index 90f7067..81b8a76 100644 --- a/gcc/analyzer/engine.cc +++ b/gcc/analyzer/engine.cc @@ -2962,7 +2962,7 @@ template <> inline void pod_hash_traits::mark_empty (value_type &v) { - v.m_fun = reinterpret_cast (NULL); + v.m_fun = NULL; } template <> inline bool @@ -2974,7 +2974,7 @@ template <> inline bool pod_hash_traits::is_empty (value_type v) { - return v.m_fun == reinterpret_cast (NULL); + return v.m_fun == NULL; } namespace ana {