Commit 93194e7c authored by Simon Giesecke's avatar Simon Giesecke Committed by Simon Giesecke

Problem: non-portable memset

Solution: add dummy pointer meber to union instead
parent 9c8fde09
...@@ -51,7 +51,7 @@ zmq::address_t::address_t (const std::string &protocol_, ...@@ -51,7 +51,7 @@ zmq::address_t::address_t (const std::string &protocol_,
address (address_), address (address_),
parent (parent_) parent (parent_)
{ {
memset (&resolved, 0, sizeof resolved); resolved.dummy = NULL;
} }
zmq::address_t::~address_t () zmq::address_t::~address_t ()
......
...@@ -76,8 +76,10 @@ struct address_t ...@@ -76,8 +76,10 @@ struct address_t
ctx_t *const parent; ctx_t *const parent;
// Protocol specific resolved address // Protocol specific resolved address
// All members must be pointers to allow for consistent initialization
union union
{ {
void *dummy;
tcp_address_t *tcp_addr; tcp_address_t *tcp_addr;
udp_address_t *udp_addr; udp_address_t *udp_addr;
#if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS \ #if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS \
......
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