This is the mail archive of the cygwin-cvs@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin] Fix strict aliasing


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=5bc753c5a2708173c77f0162d644b31707b049a0

commit 5bc753c5a2708173c77f0162d644b31707b049a0
Author: Peter Foley <pefoley2@pefoley.com>
Date:   Sat Mar 19 13:45:56 2016 -0400

    Fix strict aliasing
    
    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>

Diff:
---
 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 23861e5..d4b2afb 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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]