[FFmpeg-cvslog] avformat/network: add union for avoiding strict aliassing violations with sockaddr*

Michael Niedermayer git at videolan.org
Mon Sep 15 13:47:01 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Sep 12 01:52:38 2014 +0200| [8c1dc1f6ed119c2bffc937efc5f591cfaf0d35b3] | committer: Michael Niedermayer

avformat/network: add union for avoiding strict aliassing violations with sockaddr*

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8c1dc1f6ed119c2bffc937efc5f591cfaf0d35b3
---

 libavformat/network.h |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libavformat/network.h b/libavformat/network.h
index d89a62d..d4e1a89 100644
--- a/libavformat/network.h
+++ b/libavformat/network.h
@@ -72,6 +72,14 @@ int ff_neterrno(void);
 #include <poll.h>
 #endif
 
+typedef union sockaddr_union {
+    struct sockaddr_storage storage;
+    struct sockaddr_in in;
+#if HAVE_STRUCT_SOCKADDR_IN6
+    struct sockaddr_in6 in6;
+#endif
+} sockaddr_union;
+
 int ff_socket_nonblock(int socket, int enable);
 
 extern int ff_network_inited_globally;



More information about the ffmpeg-cvslog mailing list