Skip to content
Snippets Groups Projects
Commit a8478fc8 authored by Marc Hoersken's avatar Marc Hoersken Committed by Yang Tse
Browse files

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.
parent 849179ba
No related branches found
No related tags found
No related merge requests found
......@@ -24,14 +24,19 @@
#include "setup.h"
#ifdef HAVE_STRUCT_SOCKADDR_STORAGE
struct Curl_sockaddr_storage {
struct sockaddr_storage buffer;
};
union {
struct sockaddr sa;
struct sockaddr_in sa_in;
#ifdef ENABLE_IPV6
struct sockaddr_in6 sa_in6;
#endif
#ifdef HAVE_STRUCT_SOCKADDR_STORAGE
struct sockaddr_storage sa_stor;
#else
struct Curl_sockaddr_storage {
char buffer[256]; /* this should be big enough to fit a lot */
};
char cbuf[256]; /* this should be big enough to fit a lot */
#endif
} buffer;
};
#endif /* __SOCKADDR_H */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment