diff --git a/compat/poll/poll.c b/compat/poll/poll.c index b622982b534eea..16a6ccc4619f27 100644 --- a/compat/poll/poll.c +++ b/compat/poll/poll.c @@ -149,7 +149,7 @@ win32_compute_revents (HANDLE h, int *p_sought) case FILE_TYPE_PIPE: if (!once_only) { - NtQueryInformationFile = (PNtQueryInformationFile) + NtQueryInformationFile = (PNtQueryInformationFile)(void *) GetProcAddress (GetModuleHandleA ("ntdll.dll"), "NtQueryInformationFile"); once_only = TRUE; diff --git a/compat/win32/exit-process.h b/compat/win32/exit-process.h index 88e3bbc83c499e..5aacf3715005e5 100644 --- a/compat/win32/exit-process.h +++ b/compat/win32/exit-process.h @@ -130,7 +130,7 @@ static int exit_process(HANDLE process, int exit_code) HINSTANCE kernel32 = GetModuleHandleA("kernel32"); if (!kernel32) die("BUG: cannot find kernel32"); - exit_process_address = (LPTHREAD_START_ROUTINE) + exit_process_address = (LPTHREAD_START_ROUTINE)(void *) GetProcAddress(kernel32, "ExitProcess"); initialized = 1; } diff --git a/kwset.c b/kwset.c index 4fb6455acaf129..efc2ff41bc361a 100644 --- a/kwset.c +++ b/kwset.c @@ -38,7 +38,13 @@ #include "compat/obstack.h" #define NCHAR (UCHAR_MAX + 1) -#define obstack_chunk_alloc xmalloc +/* adapter for `xmalloc()`, which takes `size_t`, not `long` */ +static void *obstack_chunk_alloc(long size) +{ + if (size < 0) + BUG("Cannot allocate a negative amount: %ld", size); + return xmalloc(size); +} #define obstack_chunk_free free #define U(c) ((unsigned char) (c))