Cygwin: avoid GCC 8.3 errors with -Werror=class-memaccess

This commit is contained in:
Ken Brown 2019-07-15 14:22:07 -04:00
parent bae987be12
commit f0cf44dc7d
4 changed files with 6 additions and 6 deletions

View File

@ -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. */

View File

@ -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;

View File

@ -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. */

View File

@ -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)