[build] Avoid strict-aliasing warnings when building with gcc 4.4
Conventional usage of the various struct sockaddr_xxx types involves liberal use of casting, which tends to trigger strict-aliasing warnings from gcc. Avoid these now and in future by marking all the relevant types with __attribute__((may_alias)).
This commit is contained in:
@@ -40,7 +40,7 @@ struct sockaddr_tcpip {
|
||||
*/
|
||||
char pad[ sizeof ( struct sockaddr ) -
|
||||
( sizeof ( sa_family_t ) + sizeof ( uint16_t ) ) ];
|
||||
};
|
||||
} __attribute__ (( may_alias ));
|
||||
|
||||
/**
|
||||
* A transport-layer protocol of the TCP/IP stack (eg. UDP, TCP, etc)
|
||||
|
||||
Reference in New Issue
Block a user