This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
[PATCH 10/11] Fix strict aliasing
- From: Peter Foley <pefoley2 at pefoley dot com>
- To: cygwin-patches at cygwin dot com
- Cc: Peter Foley <pefoley2 at pefoley dot com>
- Date: Sat, 19 Mar 2016 13:45:56 -0400
- Subject: [PATCH 10/11] Fix strict aliasing
- Authentication-results: sourceware.org; auth=none
- References: <1458409557-13156-1-git-send-email-pefoley2 at pefoley dot com>
Fix a strict aliasing error detected by gcc 6.0+
winsup/cygwin/ChangeLog
* pinfo.cc (winpids::enum_process): Fix strict aliasing.
Signed-off-by: Peter Foley <pefoley2@pefoley.com>
---
winsup/cygwin/pinfo.cc | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index 17bf063..e6ceba8 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -1391,14 +1391,13 @@ winpids::enum_processes (bool winpid)
}
PSYSTEM_PROCESS_INFORMATION px = procs;
- char *&pxc = (char *&)px;
while (1)
{
if (px->UniqueProcessId)
add (nelem, true, (DWORD) (uintptr_t) px->UniqueProcessId);
if (!px->NextEntryOffset)
break;
- pxc += px->NextEntryOffset;
+ px = (PSYSTEM_PROCESS_INFORMATION) ((char *) px + px->NextEntryOffset);
}
}
return nelem;
--
2.7.4