Boost C++ Libraries: Ticket #6652: Boost.Thread shared_mutex.hpp:50:99: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] https://svn.boost.org/trac10/ticket/6652 <p> I'm using the Boost.Thread library since 1.47. When including &lt;boost/thread/thread.hpp&gt; my compiler (mingw 4.6) always writes a number of annoying warnings like this: </p> <p> ../boost/thread/win32/shared_mutex.hpp:50:99: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] </p> <p> another warning is: /boost/thread/win32/shared_mutex.hpp:95:33: warning: missing initializer for member 'boost::shared_mutex::state_data::shared_waiting' [-Wmissing-field-initializers] </p> <p> Same warnings in 1.47, 1.48 and 1.49 using the same compiler. </p> <p> The gcc options used: -pedantic -ansi -std=gnu++0x -Wextra -fpermissive </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6652 Trac 1.4.3 viboes Tue, 27 Mar 2012 06:00:53 GMT owner, status changed https://svn.boost.org/trac10/ticket/6652#comment:1 https://svn.boost.org/trac10/ticket/6652#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Anthony Williams</span> 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> </ul> Ticket viboes Sun, 08 Apr 2012 22:17:39 GMT status changed https://svn.boost.org/trac10/ticket/6652#comment:2 https://svn.boost.org/trac10/ticket/6652#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">new</span> </li> </ul> Ticket viboes Sun, 03 Jun 2012 14:10:00 GMT status changed https://svn.boost.org/trac10/ticket/6652#comment:3 https://svn.boost.org/trac10/ticket/6652#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket viboes Mon, 02 Jul 2012 22:13:16 GMT <link>https://svn.boost.org/trac10/ticket/6652#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6652#comment:4</guid> <description> <p> Boost 1.50 avoids these warnings if you define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN or BOOST_THREAD_VERSION=3. </p> <p> The default value for BOOST_THREAD_VERSION is 2 on 1.50, but will be 3 in a near release, so maybe you can already switch. </p> <p> I will not try to fix these warning in the legacy code. Let me know if we can close this tickets as wontfix. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sun, 08 Jul 2012 16:06:25 GMT</pubDate> <title>status changed; resolution set; milestone deleted https://svn.boost.org/trac10/ticket/6652#comment:5 https://svn.boost.org/trac10/ticket/6652#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">wontfix</span> </li> <li><strong>milestone</strong> <span class="trac-field-deleted">To Be Determined</span> </li> </ul> Ticket barnabe.faliu@… Tue, 04 Dec 2012 19:40:32 GMT <link>https://svn.boost.org/trac10/ticket/6652#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6652#comment:6</guid> <description> <p> I have the same problems using boost 1.52.0, even if I define "BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN". Any solutions ? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sat, 19 Jan 2013 10:47:37 GMT</pubDate> <title>status changed; resolution deleted https://svn.boost.org/trac10/ticket/6652#comment:7 https://svn.boost.org/trac10/ticket/6652#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">wontfix</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, 16 Feb 2013 23:25:18 GMT milestone set https://svn.boost.org/trac10/ticket/6652#comment:8 https://svn.boost.org/trac10/ticket/6652#comment:8 <ul> <li><strong>milestone</strong> → <span class="trac-field-new">Boost 1.54.0</span> </li> </ul> Ticket viboes Sat, 23 Mar 2013 02:13:01 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6652#comment:9 https://svn.boost.org/trac10/ticket/6652#comment:9 <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">fixed</span> </li> </ul> <p> Committed revision <a class="changeset" href="https://svn.boost.org/trac10/changeset/83525" title="Thread: merge from trunk. 1.54">[83525]</a>. </p> Ticket alexandre.nunes@… Thu, 19 Jan 2017 14:37:39 GMT <link>https://svn.boost.org/trac10/ticket/6652#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6652#comment:10</guid> <description> <p> Boost 1.63.0 + gcc 6.3.0 still have strict aliasing issues in win32/shared_mutex.hpp. See <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/12733" title="#12733: Bugs: construct no longer supports automatic conversion from char* to std::string (closed: fixed)">#12733</a> for a patch. </p> </description> <category>Ticket</category> </item> </channel> </rss>