[newlib-cygwin] Cygwin: avoid GCC 8.3 errors with -Werror=class-memaccess
Ken Brown
kbrown@sourceware.org
Wed Jul 17 15:09:00 GMT 2019
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=f0cf44dc7d98d751483a91869949d58f55531e6f
commit f0cf44dc7d98d751483a91869949d58f55531e6f
Author: Ken Brown <kbrown@cornell.edu>
Date: Mon Jul 15 14:22:07 2019 -0400
Cygwin: avoid GCC 8.3 errors with -Werror=class-memaccess
Diff:
---
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 860791d..74374d7 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 158f1e5..8da858d 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 0c94c61..69af5a0 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 d002268..cdbd8bd 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)
More information about the Cygwin-cvs
mailing list