diff --git a/ChangeLog b/ChangeLog index 20c31c92d..98eb266ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,7 @@ incoming connection * added more detailed instrumentation of the disk I/O thread + * fixed strict aliasing warning on gcc * fixed inconsistency when creating torrents with symlinks * properly detect windows version to initialize half-open connection limit * fixed bug in url encoder where $ would not be encoded diff --git a/include/libtorrent/entry.hpp b/include/libtorrent/entry.hpp index 21b2bae5b..a46781d63 100644 --- a/include/libtorrent/entry.hpp +++ b/include/libtorrent/entry.hpp @@ -169,24 +169,19 @@ namespace libtorrent // workaround for msvc-bug. // assumes sizeof(map) == sizeof(map) // and sizeof(list) == sizeof(list) - union - { - char data[ - max4) - , sizeof(std::map) - , sizeof(string_type) - , sizeof(integer_type)>::value]; - integer_type dummy_aligner; - }; + integer_type data[ + (max4) + , sizeof(std::map) + , sizeof(string_type) + , sizeof(integer_type)>::value + sizeof(integer_type) - 1) + / sizeof(integer_type)]; #else - union - { - char data[max4::value]; - integer_type dummy_aligner; - }; + integer_type data[ + (max4::value + sizeof(integer_type) - 1) + / sizeof(integer_type)]; #endif #ifdef TORRENT_DEBUG