Boost C++ Libraries: Ticket #7765: Warnings from shared_mutex.hpp when including thread.hpp https://svn.boost.org/trac10/ticket/7765 <p> Just by including &lt;boost/thread/thread.hpp&gt;, when I compile my program I get thoose warnings: </p> <pre class="wiki">'''C:\Boost\boost_1_52_0/boost/thread/win32/shared_mutex.hpp: In instantiation of 'T boost::shared_mutex::interlocked_compare_exchange(T*, T, T) [with T = boost::shared_mutex::state_data]': C:\Boost\boost_1_52_0/boost/thread/win32/shared_mutex.hpp:124:103: required from here C:\Boost\boost_1_52_0/boost/thread/win32/shared_mutex.hpp:52:99: warning: dereferencing type-punned pointer will break strict-aliasing rules C:\Boost\boost_1_52_0/boost/thread/win32/shared_mutex.hpp:52:99: warning: dereferencing type-punned pointer will break strict-aliasing rules C:\Boost\boost_1_52_0/boost/thread/win32/shared_mutex.hpp:53:52: warning: dereferencing type-punned pointer will break strict-aliasing rules C:\Boost\boost_1_52_0/boost/thread/win32/shared_mutex.hpp:53:52: warning: dereferencing type-punned pointer will break strict-aliasing rules''' </pre><p> Help please ! </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7765 Trac 1.4.3 mwilamowski[|]wne.uw.edu.pl Thu, 03 Jan 2013 13:08:31 GMT <link>https://svn.boost.org/trac10/ticket/7765#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7765#comment:1</guid> <description> <p> Hi, I have the same problem. Windows 7 64-bit, MinGW (g++ 4.7.0). Boost 1.52. </p> <p> I'm writing here because i noticed that this error (warnings) do not appear with O0 and O1 flags but they do with O2 and O3. Maybe that helps. </p> <p> Whats more the program compiles and works without any problems (though my application is not very complex). </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 03 Jan 2013 13:38:34 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7765#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7765#comment:2</guid> <description> <p> Just want to add that i just tested it with g++ 4.7.2 and with and without -std=gnu++11 flag. Problem appears consistently. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Thu, 03 Jan 2013 16:10:40 GMT</pubDate> <title>status, component, description, milestone changed; owner set https://svn.boost.org/trac10/ticket/7765#comment:3 https://svn.boost.org/trac10/ticket/7765#comment:3 <ul> <li><strong>owner</strong> set to <span class="trac-author">viboes</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">thread</span> </li> <li><strong>description</strong> modified (<a href="/trac10/ticket/7765?action=diff&amp;version=3">diff</a>) </li> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.52.0</span> → <span class="trac-field-new">To Be Determined</span> </li> </ul> Ticket viboes Thu, 03 Jan 2013 16:13:29 GMT <link>https://svn.boost.org/trac10/ticket/7765#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7765#comment:4</guid> <description> <p> Please, could you tell me if the warnings appear when you define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Thu, 03 Jan 2013 16:16:38 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7765#comment:5 https://svn.boost.org/trac10/ticket/7765#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">duplicate</span> </li> </ul> <p> Duplicated from <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7817" title="#7817: Bugs: Many warnings during compile time (closed: wontfix)">#7817</a> as it contains more warnings. </p> Ticket anonymous Tue, 08 Jan 2013 19:30:26 GMT <link>https://svn.boost.org/trac10/ticket/7765#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7765#comment:6</guid> <description> <p> It does appear even if i define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN !! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sat, 19 Jan 2013 10:50:11 GMT</pubDate> <title>status changed; resolution deleted https://svn.boost.org/trac10/ticket/7765#comment:7 https://svn.boost.org/trac10/ticket/7765#comment:7 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">duplicate</span> </li> </ul> <p> Reopened as BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN will not be defined by default and as <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7906" title="#7906: Bugs: Very bad performance of generic implementation of shared_mutex on windows (closed: wontfix)">#7906</a> states there is a lost in performances when this define is defined. </p> Ticket viboes Sat, 19 Jan 2013 10:51:17 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7765#comment:8 https://svn.boost.org/trac10/ticket/7765#comment:8 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">duplicate</span> </li> </ul> Ticket