diff --git a/base/dir_reader_linux.h b/base/dir_reader_linux.h
index 2b83334..b50e17c 100644
--- a/base/dir_reader_linux.h
+++ b/base/dir_reader_linux.h
@@ -49,7 +49,11 @@
   // Move to the next entry returning false if the iteration is complete.
   bool Next() {
     if (size_) {
-      linux_dirent* dirent = reinterpret_cast<linux_dirent*>(&buf_[offset_]);
+      union {
+        const unsigned char *bufp;
+        const linux_dirent* dirent;
+      };
+      bufp = &buf_[offset_];
       offset_ += dirent->d_reclen;
     }
 
@@ -72,8 +76,11 @@
     if (!size_)
       return NULL;
 
-    const linux_dirent* dirent =
-        reinterpret_cast<const linux_dirent*>(&buf_[offset_]);
+    union {
+      const unsigned char *bufp;
+      const linux_dirent* dirent;
+    };
+    bufp = &buf_[offset_];
     return dirent->d_name;
   }
 
diff --git a/base/md5.cc b/base/md5.cc
index f85cf43..ef7d0df 100644
--- a/base/md5.cc
+++ b/base/md5.cc
@@ -27,7 +27,10 @@
 struct Context {
   uint32 buf[4];
   uint32 bits[2];
-  unsigned char in[64];
+  union {
+    unsigned char in[64];
+    uint32_t in32[64/4];
+  };
 };
 
 /*
@@ -185,7 +188,7 @@
                 }
                 memcpy(p, buf, t);
                 byteReverse(ctx->in, 16);
-                MD5Transform(ctx->buf, (uint32 *)ctx->in);
+                MD5Transform(ctx->buf, ctx->in32);
                 buf += t;
                 len -= t;
         }
@@ -195,7 +198,7 @@
         while (len >= 64) {
                 memcpy(ctx->in, buf, 64);
                 byteReverse(ctx->in, 16);
-                MD5Transform(ctx->buf, (uint32 *)ctx->in);
+                MD5Transform(ctx->buf, ctx->in32);
                 buf += 64;
                 len -= 64;
         }
@@ -230,7 +233,7 @@
                 /* Two lots of padding:  Pad the first block to 64 bytes */
                 memset(p, 0, count);
                 byteReverse(ctx->in, 16);
-                MD5Transform(ctx->buf, (uint32 *)ctx->in);
+                MD5Transform(ctx->buf, ctx->in32);
 
                 /* Now fill the next block with 56 bytes */
                 memset(ctx->in, 0, 56);
@@ -241,10 +244,10 @@
         byteReverse(ctx->in, 14);
 
         /* Append length in bits and transform */
-        ((uint32 *)ctx->in)[ 14 ] = ctx->bits[0];
-        ((uint32 *)ctx->in)[ 15 ] = ctx->bits[1];
+        ctx->in32[ 14 ] = ctx->bits[0];
+        ctx->in32[ 15 ] = ctx->bits[1];
 
-        MD5Transform(ctx->buf, (uint32 *)ctx->in);
+        MD5Transform(ctx->buf, ctx->in32);
         byteReverse((unsigned char *)ctx->buf, 4);
         memcpy(digest->a, ctx->buf, 16);
         memset(ctx, 0, sizeof(ctx));    /* In case it's sensitive */
diff --git a/net/base/ip_endpoint.cc b/net/base/ip_endpoint.cc
index 55ea446..b940710 100644
--- a/net/base/ip_endpoint.cc
+++ b/net/base/ip_endpoint.cc
@@ -107,13 +107,15 @@
 }
 
 std::string IPEndPoint::ToString() const {
-  struct sockaddr_storage addr_storage;
+  union {
+    struct sockaddr_storage addr_storage;
+    struct sockaddr addr;
+  };
   size_t addr_len = sizeof(addr_storage);
-  struct sockaddr* addr = reinterpret_cast<struct sockaddr*>(&addr_storage);
-  if (!ToSockAddr(addr, &addr_len)) {
+  if (!ToSockAddr(&addr, &addr_len)) {
     return "";
   }
-  return NetAddressToStringWithPort(addr, addr_len);
+  return NetAddressToStringWithPort(&addr, addr_len);
 }
 
 bool IPEndPoint::operator<(const IPEndPoint& that) const {
diff --git a/net/base/network_change_notifier_netlink_linux.cc b/net/base/network_change_notifier_netlink_linux.cc
index 493e17a..439943e 100644
--- a/net/base/network_change_notifier_netlink_linux.cc
+++ b/net/base/network_change_notifier_netlink_linux.cc
@@ -71,13 +71,16 @@
     return -1;
   }
 
-  struct sockaddr_nl local_addr;
+  union {
+    struct sockaddr_nl local_addr;
+    struct sockaddr local_addr_generic;
+  };
   memset(&local_addr, 0, sizeof(local_addr));
   local_addr.nl_family = AF_NETLINK;
   local_addr.nl_pid = getpid();
   local_addr.nl_groups = RTMGRP_IPV4_IFADDR | RTMGRP_IPV6_IFADDR |
                          RTMGRP_NOTIFY;
-  int ret = bind(sock, reinterpret_cast<struct sockaddr*>(&local_addr),
+  int ret = bind(sock, &local_addr_generic,
                  sizeof(local_addr));
   if (ret < 0) {
     PLOG(ERROR) << "Error binding netlink socket";
diff --git a/net/socket/tcp_client_socket_libevent.cc b/net/socket/tcp_client_socket_libevent.cc
index f820955..3e8257b 100644
--- a/net/socket/tcp_client_socket_libevent.cc
+++ b/net/socket/tcp_client_socket_libevent.cc
@@ -552,10 +552,13 @@
     return;
   }
 
-  struct sockaddr_storage source_address;
+  union {
+    struct sockaddr_storage source_address;
+    struct sockaddr source_address_generic;
+  };
   socklen_t addrlen = sizeof(source_address);
   int rv = getsockname(
-      socket_, reinterpret_cast<struct sockaddr*>(&source_address), &addrlen);
+      socket_, &source_address_generic, &addrlen);
   if (rv != 0) {
     PLOG(ERROR) << "getsockname() [rv: " << rv << "] error: ";
     NOTREACHED();
@@ -565,7 +568,7 @@
 
   const std::string source_address_str =
       NetAddressToStringWithPort(
-          reinterpret_cast<const struct sockaddr*>(&source_address),
+          &source_address_generic,
           sizeof(source_address));
   net_log_.EndEvent(NetLog::TYPE_TCP_CONNECT,
                     make_scoped_refptr(new NetLogStringParameter(
@@ -684,12 +687,14 @@
   if (!IsConnected())
     return ERR_SOCKET_NOT_CONNECTED;
 
-  struct sockaddr_storage addr_storage;
+  union {
+    struct sockaddr_storage addr_storage;
+    struct sockaddr addr;
+  };
   socklen_t addr_len = sizeof(addr_storage);
-  struct sockaddr* addr = reinterpret_cast<struct sockaddr*>(&addr_storage);
-  if (getsockname(socket_, addr, &addr_len))
+  if (getsockname(socket_, &addr, &addr_len))
     return MapSystemError(errno);
-  if (!address->FromSockAddr(addr, addr_len))
+  if (!address->FromSockAddr(&addr, addr_len))
     return ERR_FAILED;
 
   return OK;
diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc
index 5f645fc..6c18ab3 100644
--- a/net/spdy/spdy_framer.cc
+++ b/net/spdy/spdy_framer.cc
@@ -1037,18 +1037,22 @@
       if (remaining_control_payload_)
         break;
     }
-    SpdyControlFrame control_frame(current_frame_buffer_, false);
-    visitor_->OnControl(&control_frame);
+    union {
+      SpdyControlFrame *control_frame;
+      SpdySynReplyControlFrame *control_frame_synreply;
+    };
+    control_frame=new SpdyControlFrame(current_frame_buffer_, false);
+    visitor_->OnControl(control_frame);
 
     // If this is a FIN, tell the caller.
-    if (control_frame.type() == SYN_REPLY &&
-        control_frame.flags() & CONTROL_FLAG_FIN) {
-      visitor_->OnStreamFrameData(reinterpret_cast<SpdySynReplyControlFrame*>(
-                                      &control_frame)->stream_id(),
+    if (control_frame->type() == SYN_REPLY &&
+        control_frame->flags() & CONTROL_FLAG_FIN) {
+      visitor_->OnStreamFrameData(control_frame_synreply->stream_id(),
                                   NULL, 0);
     }
 
     CHANGE_STATE(SPDY_IGNORE_REMAINING_PAYLOAD);
+    delete control_frame;
   } while (false);
   return original_len - len;
 }
