diff options
author | Sutou Kouhei <[email protected]> | 2023-09-06 13:59:29 +0900 |
---|---|---|
committer | Sutou Kouhei <[email protected]> | 2023-09-09 07:30:04 +0900 |
commit | 90dad2b12849b9151f62b1f3a9ac6090aadc8cc8 (patch) | |
tree | 3344e26dae71699e396b892f10aa722feefbeff0 /include | |
parent | d9ede18154e125453bc6399463c58603b9a576a8 (diff) |
memory_view: Avoid using bit field
Bit field's memory layout is implementation-defined.
See also:
https://wiki.sei.cmu.edu/confluence/display/c/EXP11-C.+Do+not+make+assumptions+regarding+the+layout+of+structures+with+bit-fields
If memory layout is implementation-defined, it's difficult to use from
FFI library such as Ruby-FFI.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/8380
Diffstat (limited to 'include')
-rw-r--r-- | include/ruby/memory_view.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/ruby/memory_view.h b/include/ruby/memory_view.h index 1ddca2d46f..42309d5afc 100644 --- a/include/ruby/memory_view.h +++ b/include/ruby/memory_view.h @@ -47,10 +47,10 @@ typedef struct { char format; /** :FIXME: what is a "native" size is unclear. */ - unsigned native_size_p: 1; + bool native_size_p; /** Endian of the component */ - unsigned little_endian_p: 1; + bool little_endian_p; /** The component's offset. */ size_t offset; |