Commit 1dae549d by David Malcolm

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<function *> (NULL);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
engine.cc:2983:21: error:
      reinterpret_cast from 'nullptr_t' to 'function *' is not allowed
  return v.m_fun == reinterpret_cast<function *> (NULL);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The casts appears to be unnecessary; eliminate them.

gcc/analyzer/ChangeLog:
	PR analyzer/93543
	* engine.cc (pod_hash_traits<function_call_string>::mark_empty):
	Eliminate reinterpret_cast.
	(pod_hash_traits<function_call_string>::is_empty): Likewise.
parent 5124c34f
2020-02-04 David Malcolm <dmalcolm@redhat.com>
PR analyzer/93543
* engine.cc (pod_hash_traits<function_call_string>::mark_empty):
Eliminate reinterpret_cast.
(pod_hash_traits<function_call_string>::is_empty): Likewise.
2020-02-03 David Malcolm <dmalcolm@redhat.com> 2020-02-03 David Malcolm <dmalcolm@redhat.com>
* constraint-manager.cc (range::constrained_to_single_element): * constraint-manager.cc (range::constrained_to_single_element):
......
...@@ -2962,7 +2962,7 @@ template <> ...@@ -2962,7 +2962,7 @@ template <>
inline void inline void
pod_hash_traits<function_call_string>::mark_empty (value_type &v) pod_hash_traits<function_call_string>::mark_empty (value_type &v)
{ {
v.m_fun = reinterpret_cast<function *> (NULL); v.m_fun = NULL;
} }
template <> template <>
inline bool inline bool
...@@ -2974,7 +2974,7 @@ template <> ...@@ -2974,7 +2974,7 @@ template <>
inline bool inline bool
pod_hash_traits<function_call_string>::is_empty (value_type v) pod_hash_traits<function_call_string>::is_empty (value_type v)
{ {
return v.m_fun == reinterpret_cast<function *> (NULL); return v.m_fun == NULL;
} }
namespace ana { namespace ana {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment