mirror of
https://github.com/curl/curl.git
synced 2025-09-27 14:36:48 +03:00
sockaddr.h: Fixed dereferencing pointer breakin strict-aliasing
Fixed warning: dereferencing pointer does break strict-aliasing rules by using a union inside the struct Curl_sockaddr_storage declaration.
This commit is contained in:
parent
849179ba27
commit
a8478fc8d3
|
@ -24,14 +24,19 @@
|
||||||
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
#ifdef HAVE_STRUCT_SOCKADDR_STORAGE
|
|
||||||
struct Curl_sockaddr_storage {
|
struct Curl_sockaddr_storage {
|
||||||
struct sockaddr_storage buffer;
|
union {
|
||||||
};
|
struct sockaddr sa;
|
||||||
#else
|
struct sockaddr_in sa_in;
|
||||||
struct Curl_sockaddr_storage {
|
#ifdef ENABLE_IPV6
|
||||||
char buffer[256]; /* this should be big enough to fit a lot */
|
struct sockaddr_in6 sa_in6;
|
||||||
};
|
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_STRUCT_SOCKADDR_STORAGE
|
||||||
|
struct sockaddr_storage sa_stor;
|
||||||
|
#else
|
||||||
|
char cbuf[256]; /* this should be big enough to fit a lot */
|
||||||
|
#endif
|
||||||
|
} buffer;
|
||||||
|
};
|
||||||
|
|
||||||
#endif /* __SOCKADDR_H */
|
#endif /* __SOCKADDR_H */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user