Hi,

2016/8/3 Wed 6:02:45 UTC+9 John Marriott wrote:
> On 03-Aug-2016 05:55, Bram Moolenaar wrote:
> > Patch 7.4.2145
> > Problem:    Win32: Using CreateThread/ExitThread is not safe.
> > Solution:   Use _beginthreadex and return from the thread. (Ken Takata)
> > Files:      src/os_win32.c
> >
> >
> This patch generates a warning, like so (on mingw64):
> gcc -c -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 
> -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -DFEAT_GUI_W32
>   -DFEAT_CLIPBOARD -pipe -march=native -Wall -O3 -fomit-frame-pointer 
> -freg-struct-return -s os_win32.c -o gobjnative/os_win32.o
> os_win32.c: In function 'mch_system_piped':
> os_win32.c:4497:4: warning: passing argument 3 of '_beginthreadex' from 
> incompatible pointer type [-Wincompatible-pointe
> r-types]
>      sub_process_writer, /* function to be executed */
>      ^~~~~~~~~~~~~~~~~~
> In file included from os_win32.c:35:0:
> C:/Programs/MinGW64/x86_64-w64-mingw32/include/process.h:33:29: note: 
> expected 'unsigned int (*)(void *)' but argument i
> s of type 'DWORD (*)(void *) {aka long unsigned int (*)(void *)}'
>     _CRTIMP uintptr_t __cdecl _beginthreadex(void *_Security,unsigned 
> _StackSize,unsigned (__stdcall *_StartAddress) (voi
> d *),void *_ArgList,unsigned _InitFlag,unsigned *_ThrdAddr);
>                               ^~~~~~~~~~~~~~

Oh. Attached patch should fix the problem.

Regards,
Ken Takata

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
# HG changeset patch
# Parent  ecc1173685b0544f46c1e7d020f16ae59a80fc56

diff --git a/src/os_win32.c b/src/os_win32.c
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -4212,7 +4212,7 @@ mch_system_classic(char *cmd, int option
  * process. This way avoid to hang up vim totally if the children
  * process take a long time to process the lines.
  */
-    static DWORD WINAPI
+    static unsigned int __stdcall
 sub_process_writer(LPVOID param)
 {
     HANDLE	    g_hChildStd_IN_Wr = param;

Raspunde prin e-mail lui