On Mon, 2014-12-22 at 00:17 -0800, Shawn Paul Landden wrote:
> There is alot of cleanup that will have to happen to turn on
> -fstrict-aliasing, but I think our code should be "correct" to the rule.
> - uint8_t buffer[INOTIFY_EVENT_MAX] _alignas_(struct
> inotify_event);
> + union {
> + struct inotify_event ev;
> + uint8_t raw[INOTIFY_EVENT_MAX];
> + } buffer;
I don't think the union is really necessary for correctness here. Access
through a character type may legally alias access by any other type.
Strictly speaking, "character types" are "char", "signed char" and
"unsigned char", and is not required to include uint8_t, but I don't
think this is an issue in practice. Thus the existing code should be
strict-aliasing safe unless I'm missing something.
_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel