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

ruby-changes:51229

From: Hi <ko1@a...>
Date: Tue, 15 May 2018 19:15:15 +0900 (JST)
Subject: [ruby-changes:51229] Re: normal:r63435 (trunk): vm_core.h (rb_execution_context_t): interrupt_mask size to match interrupt_flag

Hi normal.

I got following error with r63435.

```
make: Entering directory '/Users/hsbt/Documents/
github.com/ruby/ruby/.x86_64-darwin'
BASERUBY = /Users/hsbt/.rbenv/shims/ruby --disable=gems
CC = clang
LD = ld
LDSHARED = clang -dynamic -bundle
CFLAGS = -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses
-Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare
-Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign
-Wunused-variable -Werror=implicit-int -Werror=pointer-arith
-Werror=write-strings -Werror=declaration-after-statement
-Werror=shorten-64-to-32 -Werror=implicit-function-declaration
-Werror=division-by-zero -Werror=deprecated-declarations
-Wno-overlength-strings -Wmissing-noreturn -Werror=extra-tokens   -pipe
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow
-DRUBY_DEVEL=1 -fvisibility=hidden -DRUBY_EXPORT -fPIE
-DCANONICALIZATION_FOR_MATHN
CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT
-D_REENTRANT   -I. -I.ext/include/x86_64-darwin17 -I../include -I..
-I../enc/unicode/10.0.0
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress
-fstack-protector -Wl,-pie -framework Foundation
SOLIBS = -lpthread -lgmp -ldl -lobjc
LANG =
LC_ALL =
LC_CTYPE = UTF-8
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.6.0
Thread model: posix
InstalledDir:
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
compiling ../signal.c
generating prelude.c
../signal.c:1035:26: error: implicit conversion loses integer precision:
'volatile unsigned long' to 'rb_atomic_t' (aka 'unsigned int')
       [-Werror,-Wshorten-64-to-32]
     ec->interrupt_mask = old_interrupt_mask;
                        ~ ^~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [Makefile:394: signal.o] Error 1
make: *** Waiting for unfinished jobs....
prelude.c unchanged
make: Leaving directory '/Users/hsbt/Documents/
github.com/ruby/ruby/.x86_64-darwin'
```

Please confirm it.

On Tue, May 15, 2018 at 7:11 PM <normal@r...> wrote:

> normal  2018-05-15 19:11:32 +0900 (Tue, 15 May 2018)

>    New Revision: 63435


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

>    Log:
>      vm_core.h (rb_execution_context_t): interrupt_mask size to match
interrupt_flag

>      rb_atomic_t is 32-bit on 64-bit platforms (including the popular
>      x86-64 Linux), so save 4 bytes on this structure.  This doesn't
>      result in any final size reduction due to padding, yet, but
>      future changes are possible to shrink rb_execution_context_t

>    Modified files:
>      trunk/vm_core.h



-- 
SHIBATA Hiroshi hsbt@r...
http://www.hsbt.org/
Index: vm_core.h
===================================================================
--- vm_core.h	(revision 63434)
+++ vm_core.h	(revision 63435)
@@ -787,7 +787,7 @@ typedef struct rb_execution_context_stru https://github.com/ruby/ruby/blob/trunk/vm_core.h#L787
 
     /* interrupt flags */
     rb_atomic_t interrupt_flag;
-    unsigned long interrupt_mask;
+    rb_atomic_t interrupt_mask; /* size should match flag */
 
     rb_fiber_t *fiber_ptr;
     struct rb_thread_struct *thread_ptr;

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

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