diff options
author | Nobuyoshi Nakada <[email protected]> | 2020-12-13 11:34:57 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2020-12-13 11:57:05 +0900 |
commit | 97e6c28db4cfb2b383870769940ade08cbe1a6bf (patch) | |
tree | 5856eb91d0b9c632e4205b0b22077a0394cd2f33 /internal/gc.h | |
parent | 88f3ce12d32ffbef983b0950743c20253ea2d0c6 (diff) |
Narrowed down unaligned member access region in RB_OBJ_WRITE
Since UNALIGNED_MEMBER_ACCESS assigns to an intermediate variable,
it can cause unused-value warnings.
Diffstat (limited to 'internal/gc.h')
-rw-r--r-- | internal/gc.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/gc.h b/internal/gc.h index ed8616d5ac..a602f0c9b3 100644 --- a/internal/gc.h +++ b/internal/gc.h @@ -58,8 +58,8 @@ struct rb_objspace; /* in vm_core.h */ #define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem) #define RB_OBJ_WRITE(a, slot, b) \ - UNALIGNED_MEMBER_ACCESS(\ - rb_obj_write((VALUE)(a), (VALUE *)(slot), (VALUE)(b), __FILE__, __LINE__)) + rb_obj_write((VALUE)(a), UNALIGNED_MEMBER_ACCESS((VALUE *)(slot)), \ + (VALUE)(b), __FILE__, __LINE__) /* gc.c */ extern VALUE *ruby_initial_gc_stress_ptr; |