-
Notifications
You must be signed in to change notification settings - Fork 253
Closed
Description
Describe the bug
On some CPU architectures that have strict alignment requirements, the OS socket address storage buffer triggers a warning/error about casts that increase alignment. For example:
os-impl-bsd-sockets.c:200:9: error: cast increases required alignment of target type [-Werror=cast-align]
sa = (const struct sockaddr *)Addr->AddrData;
To Reproduce
Build on an architecture that has strict alignment requirements (e.g. SPARC, MIPS, etc)
Expected behavior
Should build cleanly, no warnings.
System observed on:
- MIPS Linux (QEMU)
Additional context
Not likely to be a "real" alignment issue as this specific instance follows a uint32 value, so it will already have 32 bit alignment already. Adding a union wrapper will squelch the warning though.
Reporter Info
Joseph Hickey, Vantage Systems, Inc.
Reactions are currently unavailable