From a5ac89cbbd9e8b8014d9558709c70d5a1b6326bc Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 11 Oct 2005 18:17:59 +0000 Subject: [PATCH] * Makefile.common (CFLAGS_COMMON): Add -Wstrict-aliasing. --- winsup/ChangeLog | 4 ++++ winsup/Makefile.common | 2 +- winsup/testsuite/winsup.api/mmaptest03.c | 1 + winsup/utils/strace.cc | 7 +++++-- winsup/w32api/include/winbase.h | 1 + winsup/w32api/include/winsock.h | 2 +- 6 files changed, 13 insertions(+), 4 deletions(-) diff --git a/winsup/ChangeLog b/winsup/ChangeLog index 3885217c5..b2593c64e 100644 --- a/winsup/ChangeLog +++ b/winsup/ChangeLog @@ -1,3 +1,7 @@ +2005-10-11 Christopher Faylor + + * Makefile.common (CFLAGS_COMMON): Add -Wstrict-aliasing. + 2005-03-22 Christopher Faylor * Makefile.common: Add -dD to options when creating preprocess files. diff --git a/winsup/Makefile.common b/winsup/Makefile.common index 4f397a3d6..96e58ef2d 100644 --- a/winsup/Makefile.common +++ b/winsup/Makefile.common @@ -10,7 +10,7 @@ # This makefile requires GNU make. -CFLAGS_COMMON:=-Wall -Wwrite-strings -fno-common -pipe -fbuiltin -fmessage-length=0# -finline-functions +CFLAGS_COMMON:=-Wall -Wstrict-aliasing -Wwrite-strings -fno-common -pipe -fbuiltin -fmessage-length=0# -finline-functions MALLOC_DEBUG:=#-DMALLOC_DEBUG -I/cygnus/src/uberbaum/winsup/cygwin/dlmalloc MALLOC_OBJ:=#/cygnus/src/uberbaum/winsup/cygwin/dlmalloc/malloc.o diff --git a/winsup/testsuite/winsup.api/mmaptest03.c b/winsup/testsuite/winsup.api/mmaptest03.c index 8046f0bf8..b3141d998 100644 --- a/winsup/testsuite/winsup.api/mmaptest03.c +++ b/winsup/testsuite/winsup.api/mmaptest03.c @@ -103,6 +103,7 @@ main(int argc, char **argv) what = "child"; } + if (argc > 1) sleep (10); if (pid == -1) perror_exit ("fork failed"); diff --git a/winsup/utils/strace.cc b/winsup/utils/strace.cc index 1bd54ced0..f601c4418 100644 --- a/winsup/utils/strace.cc +++ b/winsup/utils/strace.cc @@ -128,7 +128,7 @@ get_child (DWORD id) } static void -remove_child (DWORD id) +remove_child (FILE *ofile, DWORD id) { child_list *c; if (id == lastid) @@ -138,6 +138,9 @@ remove_child (DWORD id) { child_list *c1 = c->next; c->next = c1->next; + DWORD n = 0xdeadbeef; + GetExitCodeProcess (c1->hproc, &n); + fprintf (ofile, "process %u exited with status %p\n", id, n); free (c1); return; } @@ -627,7 +630,7 @@ proc_child (unsigned mask, FILE *ofile, pid_t pid) break; case EXIT_PROCESS_DEBUG_EVENT: - remove_child (ev.dwProcessId); + remove_child (ofile, ev.dwProcessId); break; case EXCEPTION_DEBUG_EVENT: if (ev.u.Exception.ExceptionRecord.ExceptionCode != diff --git a/winsup/w32api/include/winbase.h b/winsup/w32api/include/winbase.h index f05b61ee2..7db8db547 100644 --- a/winsup/w32api/include/winbase.h +++ b/winsup/w32api/include/winbase.h @@ -1350,6 +1350,7 @@ WINBASEAPI HANDLE WINAPI GetCurrentProcess(void); WINBASEAPI DWORD WINAPI GetCurrentProcessId(void); WINBASEAPI HANDLE WINAPI GetCurrentThread(void); WINBASEAPI DWORD WINAPI GetCurrentThreadId(void); +WINBASEAPI DWORD WINAPI GetProcessId(HANDLE); #define GetCurrentTime GetTickCount WINBASEAPI BOOL WINAPI GetDefaultCommConfigA(LPCSTR,LPCOMMCONFIG,PDWORD); WINBASEAPI BOOL WINAPI GetDefaultCommConfigW(LPCWSTR,LPCOMMCONFIG,PDWORD); diff --git a/winsup/w32api/include/winsock.h b/winsup/w32api/include/winsock.h index d99d84cbc..7c3375f93 100644 --- a/winsup/w32api/include/winsock.h +++ b/winsup/w32api/include/winsock.h @@ -351,8 +351,8 @@ struct sockproto { #define PF_INET6 AF_INET6 #define PF_MAX AF_MAX #define SOL_SOCKET 0xffff -#define SOMAXCONN 5 #if !(defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__)) +#define SOMAXCONN 5 #define MSG_OOB 1 #define MSG_PEEK 2 #define MSG_DONTROUTE 4