On Sat, Jan 24, 2015 at 5:04 PM, Peter Dimov
Olaf van der Spek wrote:
On Sat, Jan 24, 2015 at 3:54 PM, Beman Dawes
wrote: struct { big_int32_buf_t code; big_uint32_buf_t length; little_int16_buf_t version; big_int32_buf_ut shape_type; } data;
You're mixing aligned and unaligned types. Shouldn't all be unaligned? See the docs: "Warning: Code that uses aligned types is possibly non-portable because alignment requirements vary between hardware architectures and because alignment may be affected by compiler switches or pragmas. For example, alignment of an 64-bit integer may be to a 32-bit boundary on a 32-bit machine. Furthermore, aligned types are only available on architectures with 16, 32, and 64-bit integer types."
Yes, a good argument against having aligned buffers at all, even though the docs do provide rationale for them. If you want aligned, use the non-buffer types.
I think the default / shortest name types should be unaligned, with aligned access being explicit. -- Olaf