[前][次][番号順一覧][スレッド一覧]

ruby-changes:50121

From: k0kubun <ko1@a...>
Date: Tue, 6 Feb 2018 02:00:49 +0900 (JST)
Subject: [ruby-changes:50121] k0kubun:r62239 (trunk): mjit.c: fix MinGW warning by r62221

k0kubun	2018-02-06 02:00:43 +0900 (Tue, 06 Feb 2018)

  New Revision: 62239

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62239

  Log:
    mjit.c: fix MinGW warning by r62221
    
    mjit.c: In function 'worker':
    mjit.c:126:64: warning: passing argument 1 of '_InterlockedExchangePointer' from incompatible pointer type [-Wincompatible-pointer-types]
     #  define MJIT_ATOMIC_SET(var, val) InterlockedExchangePointer(&(var), val)
                                                                    ^
    mjit.c:828:17: note: in expansion of macro 'MJIT_ATOMIC_SET'
                     MJIT_ATOMIC_SET(node->unit->iseq->body->jit_func, func);
                     ^
    In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/winnt.h:27:0,
                     from C:/msys64/mingw64/x86_64-w64-mingw32/include/minwindef.h:163,
                     from C:/msys64/mingw64/x86_64-w64-mingw32/include/windef.h:8,
                     from C:/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:69,
                     from C:/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                     from ./include/ruby/win32.h:41,
                     from ./include/ruby/defines.h:250,
                     from ./include/ruby/ruby.h:29,
                     from ./include/ruby.h:33,
                     from internal.h:15,
                     from mjit.c:76:
    C:/msys64/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h:1420:7: note: expected 'void * volatile*' but argument is of type 'VALUE (**)(struct rb_execution_context_struct *, struct rb_control_frame_struct *) {aka long long unsigned int (**)(struct rb_execution_context_struct *, struct rb_control_frame_struct *)}'
     void *_InterlockedExchangePointer(void *volatile *Target,void *Value) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~

  Modified files:
    trunk/mjit.c
Index: mjit.c
===================================================================
--- mjit.c	(revision 62238)
+++ mjit.c	(revision 62239)
@@ -123,7 +123,7 @@ typedef intptr_t pid_t; https://github.com/ruby/ruby/blob/trunk/mjit.c#L123
 /* Atomically set function pointer if possible. */
 #ifdef _WIN32
 # ifdef InterlockedExchangePointer
-#  define MJIT_ATOMIC_SET(var, val) InterlockedExchangePointer(&(var), val)
+#  define MJIT_ATOMIC_SET(var, val) InterlockedExchangePointer((void **)&(var), (void *)val)
 # else
 #  define MJIT_ATOMIC_SET(var, val) (void)((var) = (val))
 # endif

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]