This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
[PATCH 1/5] Cygwin: avoid GCC 8.3 errors with -Werror=class-memaccess
- From: Ken Brown <kbrown at cornell dot edu>
- To: "cygwin-patches at cygwin dot com" <cygwin-patches at cygwin dot com>
- Date: Tue, 16 Jul 2019 17:34:24 +0000
- Subject: [PATCH 1/5] Cygwin: avoid GCC 8.3 errors with -Werror=class-memaccess
- Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=cornell.edu;dmarc=pass action=none header.from=cornell.edu;dkim=pass header.d=cornell.edu;arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/xSTwEfWxXoFaxpX6XF5VM6B8vzZRhHYjDuUC9KVEIQ=; b=kLnFOZXKxJxHhPebi/EZ8ullPgWMbGrWud05VpW4cx2rS649QZgztLiZyH8oAhncI5C2kP4Eyo9OkmsNqj9sdSzFiFq3haAWJmYBwQknJaVDKxGec0N2SsZGti5MEvZn37wNEP4M8D/8GmRM0t1q9N2Z+S0J4VzyUK1npvEpw4Ew2/s0cSvW6lB0SyVJqeN+1lj5x7gu3XnJBlPKS4ymigaboVO1BR/B9jxTzTRYx4rPyQ7tm6N3kh8aHgP+dxDXe3XVi0E8LywmiIxCdCA8BHdEbGBV5YwrnnzvUUubIv7PZ6+rIbCDO+LuhEi0jYZCzL4M2uqjZUmXx27m16BQmg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FeftK8aV6iYaDTeNA7zKulVaVI/ayusOXNfb9nbiYMyuR5H8iu43PJ10f1H9pm9KyRJjSOv4VJo69dCKLN1fZh1i/lya3+wUbG7FYKx2+MzMNmotaS6pOigH3WpxbN6eITwcnTQT+OYiT4KH3JvcEXfjefDYaC37OU/iylXzN8ysBs+s7ZkjEbIq7tfBDjod/gBD7CrUlmtQ1wPSWPaXurzg0eWQcRenaruOzx9ZFi5SJxd7iF+Y9IfUcenEA3i6AQuMy7c3lyWd3jXf/xCB/KpDgA9/Tq/RIzpRb4XYCJv1iA7YUEdhprEJ2nquuiivwbgZje2PSkDvdWkjk32Wkw==
- References: <20190716173407.17040-1-kbrown@cornell.edu>
---
winsup/cygwin/flock.cc | 2 +-
winsup/cygwin/path.cc | 4 ++--
winsup/cygwin/path.h | 2 +-
winsup/cygwin/pinfo.cc | 4 ++--
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/winsup/cygwin/flock.cc b/winsup/cygwin/flock.cc
index 860791d7b..74374d727 100644
--- a/winsup/cygwin/flock.cc
+++ b/winsup/cygwin/flock.cc
@@ -1736,7 +1736,7 @@ lf_split (lockf_t *lock1, lockf_t *lock2, lockf_t **split)
splitlock = *split;
assert (splitlock != NULL);
*split = splitlock->lf_next;
- memcpy (splitlock, lock1, sizeof *splitlock);
+ memcpy ((void *) splitlock, lock1, sizeof *splitlock);
/* We have to unset the obj HANDLE here which has been copied by the
above memcpy, so that the calling function recognizes the new object.
See post-lf_split handling in lf_setlock and lf_clearlock. */
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 158f1e5fb..8da858da1 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -1299,7 +1299,7 @@ path_conv::serialize (HANDLE h, unsigned int &n) const
n = 0;
return NULL;
}
- memcpy (&pcf->pc, this, sizeof *this);
+ memcpy ((void *) &pcf->pc, this, sizeof *this);
pcf->hdl = h;
pcf->name_len = nlen;
pcf->posix_len = plen;
@@ -1318,7 +1318,7 @@ path_conv::deserialize (void *bufp)
char *p;
HANDLE ret;
- memcpy (this, &pcf->pc, sizeof *this);
+ memcpy ((void *) this, &pcf->pc, sizeof *this);
wide_path = uni_path.Buffer = NULL;
uni_path.MaximumLength = uni_path.Length = 0;
path = posix_path = NULL;
diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h
index 0c94c6152..69af5a01c 100644
--- a/winsup/cygwin/path.h
+++ b/winsup/cygwin/path.h
@@ -313,7 +313,7 @@ class path_conv
path_conv& eq_worker (const path_conv& pc, const char *in_path)
{
free_strings ();
- memcpy (this, &pc, sizeof pc);
+ memcpy ((void *) this, &pc, sizeof pc);
/* The device info might contain pointers to allocated strings, in
contrast to statically allocated strings. Calling device::dup()
will duplicate the string if the source was allocated. */
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index d002268ed..cdbd8bd7e 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -1418,12 +1418,12 @@ winpids::add (DWORD& nelem, bool winpid, DWORD pid)
{
npidlist += slop_pidlist;
pidlist = (DWORD *) realloc (pidlist, size_pidlist (npidlist + 1));
- pinfolist = (pinfo *) realloc (pinfolist, size_pinfolist (npidlist + 1));
+ pinfolist = (pinfo *) realloc ((void *) pinfolist, size_pinfolist (npidlist + 1));
}
_onreturn onreturn;
pinfo& p = pinfolist[nelem];
- memset (&p, 0, sizeof (p));
+ memset ((void *) &p, 0, sizeof (p));
bool perform_copy;
if (cygpid == myself->pid)
--
2.21.0