ruby-changes:51945
From: k0kubun <ko1@a...>
Date: Thu, 2 Aug 2018 22:03:58 +0900 (JST)
Subject: [ruby-changes:51945] k0kubun:r64160 (trunk): mjit.c: suppress warnings by -Wunused-value
k0kubun 2018-08-02 22:03:34 +0900 (Thu, 02 Aug 2018) New Revision: 64160 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64160 Log: mjit.c: suppress warnings by -Wunused-value on MinGW with __atomic_exchange_n(). It returns the previous pointer value but obviously it's not needed in MJIT's usage. mjit.c: In function 'compact_all_jit_code': ruby_atomic.h:11:36: warning: value computed is not used [-Wunused-value] # define ATOMIC_EXCHANGE(var, val) __atomic_exchange_n(&(var), (val), __ATOMIC_SEQ_CST) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Modified files: trunk/mjit.c Index: mjit.c =================================================================== --- mjit.c (revision 64159) +++ mjit.c (revision 64160) @@ -140,7 +140,7 @@ typedef intptr_t pid_t; https://github.com/ruby/ruby/blob/trunk/mjit.c#L140 #endif /* Atomically set function pointer if possible. */ -#define MJIT_ATOMIC_SET(var, val) ATOMIC_PTR_EXCHANGE(var, val) +#define MJIT_ATOMIC_SET(var, val) (void)ATOMIC_PTR_EXCHANGE(var, val) /* A copy of MJIT portion of MRI options since MJIT initialization. We need them as MJIT threads still can work when the most MRI data were -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/