[Bug c/79216] Feature request: byte order attributes
hpa at zytor dot com
gcc-bugzilla@gcc.gnu.org
Wed Jan 25 02:04:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79216
--- Comment #4 from H. Peter Anvin <hpa at zytor dot com> ---
As in, I would expect that:
struct foo __attribute__((scalar_storage_order("big-endian")))
{
uint32_t bar;
} foo;
uint32_t *baz = &foo.bar;
... would give an error on a littleendian architecture and a warning on a
bigendian architecture, however, at this point it seems to be completely quiet
about it.
Finally, the section in the manual about type-punning in the presence of this
attribute is very opaque to me. I am not sure what it means is allowed or
disallowed, or how things would work in the presence of casts.
More information about the Gcc-bugs
mailing list