3 ms·
> Accessing a char value as if it were a different type just isn’t allowed. Is this still bad if you have the proper alignment (by attribute or implicit placem
by dooglius 7y ago
> Accessing a char value as if it were a different type just isn’t allowed.
Is this still bad if you have the proper alignment (by attribute or implicit placement in a struct), or have it wrapped in a packed struct? There's a lot of code that does this, e.g. overloading the definition of struct sockaddr.
- gpderetta 7y agosockaddr is problematic. Semi-recently glibc had to add compiler magic (may_alias IIRC) to prevent breakage (posix says it has to work, so it is up to the implementer to make it work).