Boost C++ Libraries: Ticket #7817: Many warnings during compile time https://svn.boost.org/trac10/ticket/7817 <p> MinGW 4.7.2 </p> <pre class="wiki">gcc.compile.c++ bin.v2\libs\thread\build\gcc-mingw-4.7.2\release\link-static\threading-multi\win32\thread.o In file included from ./boost/thread/shared_mutex.hpp:18:0, from ./boost/thread/detail/thread_group.hpp:9, from ./boost/thread/thread.hpp:24, from libs\thread\src\win32\thread.cpp:15: ./boost/thread/win32/shared_mutex.hpp: In constructor 'boost::shared_mutex::shared_mutex()': ./boost/thread/win32/shared_mutex.hpp:98:33: warning: missing initializer for member 'boost::shared_mutex::state_data::shared_waiting' [-Wmissing -field-initializers] ./boost/thread/win32/shared_mutex.hpp:98:33: warning: missing initializer for member 'boost::shared_mutex::state_data::exclusive' [-Wmissing-fiel d-initializers] ./boost/thread/win32/shared_mutex.hpp:98:33: warning: missing initializer for member 'boost::shared_mutex::state_data::upgrade' [-Wmissing-field- initializers] ./boost/thread/win32/shared_mutex.hpp:98:33: warning: missing initializer for member 'boost::shared_mutex::state_data::exclusive_waiting' [-Wmiss ing-field-initializers] ./boost/thread/win32/shared_mutex.hpp:98:33: warning: missing initializer for member 'boost::shared_mutex::state_data::exclusive_waiting_blocked' [-Wmissing-field-initializers] libs\thread\src\win32\thread.cpp: In static member function 'static unsigned int boost::thread::hardware_concurrency()': libs\thread\src\win32\thread.cpp:390:30: warning: missing initializer for member '_SYSTEM_INFO::dwPageSize' [-Wmissing-field-initializers] libs\thread\src\win32\thread.cpp:390:30: warning: missing initializer for member '_SYSTEM_INFO::lpMinimumApplicationAddress' [-Wmissing-field-ini tializers] libs\thread\src\win32\thread.cpp:390:30: warning: missing initializer for member '_SYSTEM_INFO::lpMaximumApplicationAddress' [-Wmissing-field-ini tializers] libs\thread\src\win32\thread.cpp:390:30: warning: missing initializer for member '_SYSTEM_INFO::dwActiveProcessorMask' [-Wmissing-field-initializ ers] libs\thread\src\win32\thread.cpp:390:30: warning: missing initializer for member '_SYSTEM_INFO::dwNumberOfProcessors' [-Wmissing-field-initialize rs] libs\thread\src\win32\thread.cpp:390:30: warning: missing initializer for member '_SYSTEM_INFO::dwProcessorType' [-Wmissing-field-initializers] libs\thread\src\win32\thread.cpp:390:30: warning: missing initializer for member '_SYSTEM_INFO::dwAllocationGranularity' [-Wmissing-field-initial izers] libs\thread\src\win32\thread.cpp:390:30: warning: missing initializer for member '_SYSTEM_INFO::wProcessorLevel' [-Wmissing-field-initializers] libs\thread\src\win32\thread.cpp:390:30: warning: missing initializer for member '_SYSTEM_INFO::wProcessorRevision' [-Wmissing-field-initializers ] libs\thread\src\win32\thread.cpp: In function 'LARGE_INTEGER boost::this_thread::{anonymous}::get_due_time(const boost::detail::timeout&amp;)': libs\thread\src\win32\thread.cpp:412:44: warning: missing initializer for member '_LARGE_INTEGER::&lt;anonymous struct&gt;::HighPart' [-Wmissing-field- initializers] libs\thread\src\win32\thread.cpp:426:53: warning: missing initializer for member '_SYSTEMTIME::wMonth' [-Wmissing-field-initializers] libs\thread\src\win32\thread.cpp:426:53: warning: missing initializer for member '_SYSTEMTIME::wDayOfWeek' [-Wmissing-field-initializers] libs\thread\src\win32\thread.cpp:426:53: warning: missing initializer for member '_SYSTEMTIME::wDay' [-Wmissing-field-initializers] libs\thread\src\win32\thread.cpp:426:53: warning: missing initializer for member '_SYSTEMTIME::wHour' [-Wmissing-field-initializers] libs\thread\src\win32\thread.cpp:426:53: warning: missing initializer for member '_SYSTEMTIME::wMinute' [-Wmissing-field-initializers] libs\thread\src\win32\thread.cpp:426:53: warning: missing initializer for member '_SYSTEMTIME::wSecond' [-Wmissing-field-initializers] libs\thread\src\win32\thread.cpp:426:53: warning: missing initializer for member '_SYSTEMTIME::wMilliseconds' [-Wmissing-field-initializers] In file included from ./boost/thread/shared_mutex.hpp:18:0, from ./boost/thread/detail/thread_group.hpp:9, from ./boost/thread/thread.hpp:24, from libs\thread\src\win32\thread.cpp:15: ./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]': ./boost/thread/win32/shared_mutex.hpp:124:103: required from here ./boost/thread/win32/shared_mutex.hpp:52:99: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] ./boost/thread/win32/shared_mutex.hpp:52:99: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] ./boost/thread/win32/shared_mutex.hpp:53:52: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] ./boost/thread/win32/shared_mutex.hpp:53:52: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7817 Trac 1.4.3 viboes Fri, 21 Dec 2012 22:21:33 GMT owner, status, severity changed https://svn.boost.org/trac10/ticket/7817#comment:1 https://svn.boost.org/trac10/ticket/7817#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> <li><strong>severity</strong> <span class="trac-field-old">Problem</span> → <span class="trac-field-new">Cosmetic</span> </li> </ul> Ticket viboes Sun, 30 Dec 2012 16:27:26 GMT <link>https://svn.boost.org/trac10/ticket/7817#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7817#comment:2</guid> <description> <p> Do you have a patch? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Thu, 03 Jan 2013 16:14:05 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7817#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7817#comment:3</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>anonymous</dc:creator> <pubDate>Fri, 04 Jan 2013 15:48:03 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7817#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7817#comment:4</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/7817#comment:3" title="Comment 3">viboes</a>: </p> <blockquote class="citation"> <p> Please, could you tell me if the warnings appear when you define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN? </p> </blockquote> <p> I eliminated Boost form my project and am unable to reproduce the warnings quickly. It will take a several days. Sorry. Please wait. Or may be somebody other will try to reproduce. As far as I remember they happen during Boost build. </p> </description> <category>Ticket</category> </item> <item> <author>barnabe.faliu@…</author> <pubDate>Tue, 08 Jan 2013 19:31:41 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7817#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7817#comment:5</guid> <description> <p> Warnings still appears even if i define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN </p> </description> <category>Ticket</category> </item> <item> <author>olgood@…</author> <pubDate>Tue, 08 Jan 2013 19:40:45 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7817#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7817#comment:6</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/7817#comment:5" title="Comment 5">barnabe.faliu@…</a>: </p> <blockquote class="citation"> <p> Warnings still appears even if i define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN </p> </blockquote> <p> Could you please provide me a command line which allow me quickly to reproduce the issue on my set too? Thanks. </p> </description> <category>Ticket</category> </item> <item> <author>Barnabé Faliu <barnabe.faliu@…></author> <pubDate>Tue, 08 Jan 2013 19:45:50 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7817#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7817#comment:7</guid> <description> <pre class="wiki">#include &lt;iostream&gt; #include &lt;boost/thread/thread.hpp&gt; #define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN using namespace std; int main() { cout &lt;&lt; "!!!Hello World!!!" &lt;&lt; endl; // prints !!!Hello World!!! return 0; } </pre><p> This is the only lines in my file. I included <strong>C:\Boost\boost_1_52_0</strong>, added this library path : <strong>C:\Boost\boost_1_52_0\lib</strong> and thoose libraries : <strong>boost_system-mgw47-1_52</strong> <strong>boost_thread-mgw47-mt-sd-1_52</strong> </p> </description> <category>Ticket</category> </item> <item> <author>Barnabé Faliu <barnabe.faliu@…></author> <pubDate>Tue, 08 Jan 2013 20:09:51 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/7817 https://svn.boost.org/trac10/ticket/7817 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">Shared_mutex_error1.png</span> </li> </ul> Ticket Barnabé Faliu <barnabe.faliu@…> Tue, 08 Jan 2013 20:10:07 GMT attachment set https://svn.boost.org/trac10/ticket/7817 https://svn.boost.org/trac10/ticket/7817 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">Shared_mutex_error2.png</span> </li> </ul> Ticket olgood@… Tue, 08 Jan 2013 20:10:48 GMT <link>https://svn.boost.org/trac10/ticket/7817#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7817#comment:8</guid> <description> <p> Thanks. </p> <p> I remembered that my program was even shorter - just #include &lt;boost/thread/threads.hpp&gt; and main(int,char<strong>){} </strong></p> <p> This gave warnings and one error (I asked about this on <a class="missing wiki">StackOverflow</a>). </p> <p> And I remembered I've just fixed that warnings for my Boost's sources without backup. So, now I'm unable to reproduce the issue because do not have sources. </p> <p> Hope, now you'll help Boost guys to fix the issue. </p> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/7817#comment:7" title="Comment 7">Barnabé Faliu &lt;barnabe.faliu@…&gt;</a>: </p> <blockquote class="citation"> <pre class="wiki">#include &lt;iostream&gt; #include &lt;boost/thread/thread.hpp&gt; #define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN using namespace std; int main() { cout &lt;&lt; "!!!Hello World!!!" &lt;&lt; endl; // prints !!!Hello World!!! return 0; } </pre><p> This is the only lines in my file. I included <strong>C:\Boost\boost_1_52_0</strong>, added this library path : <strong>C:\Boost\boost_1_52_0\lib</strong> and thoose libraries : <strong>boost_system-mgw47-1_52</strong> <strong>boost_thread-mgw47-mt-sd-1_52</strong> </p> </blockquote> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 08 Jan 2013 20:15:16 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7817#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7817#comment:9</guid> <description> <p> But hey! Just noted: seems you have to put define before include. Isn't it? </p> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/7817#comment:7" title="Comment 7">Barnabé Faliu &lt;barnabe.faliu@…&gt;</a>: </p> <blockquote class="citation"> <pre class="wiki">#include &lt;iostream&gt; #include &lt;boost/thread/thread.hpp&gt; #define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN using namespace std; int main() { cout &lt;&lt; "!!!Hello World!!!" &lt;&lt; endl; // prints !!!Hello World!!! return 0; } </pre><p> This is the only lines in my file. I included <strong>C:\Boost\boost_1_52_0</strong>, added this library path : <strong>C:\Boost\boost_1_52_0\lib</strong> and thoose libraries : <strong>boost_system-mgw47-1_52</strong> <strong>boost_thread-mgw47-mt-sd-1_52</strong> </p> </blockquote> </description> <category>Ticket</category> </item> <item> <author>Barnabé Faliu <barnabe.faliu@…></author> <pubDate>Tue, 08 Jan 2013 20:19:42 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7817#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7817#comment:10</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/7817#comment:9" title="Comment 9">anonymous</a>: </p> <p> Problem solved ! Thank you very much </p> <blockquote class="citation"> <p> But hey! Just noted: seems you have to put define before include. Isn't it? </p> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/7817#comment:7" title="Comment 7">Barnabé Faliu &lt;barnabe.faliu@…&gt;</a>: </p> <blockquote class="citation"> <pre class="wiki">#include &lt;iostream&gt; #include &lt;boost/thread/thread.hpp&gt; #define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN using namespace std; int main() { cout &lt;&lt; "!!!Hello World!!!" &lt;&lt; endl; // prints !!!Hello World!!! return 0; } </pre><p> This is the only lines in my file. I included <strong>C:\Boost\boost_1_52_0</strong>, added this library path : <strong>C:\Boost\boost_1_52_0\lib</strong> and thoose libraries : <strong>boost_system-mgw47-1_52</strong> <strong>boost_thread-mgw47-mt-sd-1_52</strong> </p> </blockquote> </blockquote> </description> <category>Ticket</category> </item> <item> <author>olgood@…</author> <pubDate>Tue, 08 Jan 2013 20:24:13 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7817#comment:11 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7817#comment:11</guid> <description> <p> Therefore, the answer for viboes' question regarding the flag BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN is positive: yes the flag eliminates that warnings. </p> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/7817#comment:10" title="Comment 10">Barnabé Faliu &lt;barnabe.faliu@…&gt;</a>: </p> <blockquote class="citation"> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/7817#comment:9" title="Comment 9">anonymous</a>: </p> <p> Problem solved ! Thank you very much </p> <blockquote class="citation"> <p> But hey! Just noted: seems you have to put define before include. Isn't it? </p> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/7817#comment:7" title="Comment 7">Barnabé Faliu &lt;barnabe.faliu@…&gt;</a>: </p> <blockquote class="citation"> <pre class="wiki">#include &lt;iostream&gt; #include &lt;boost/thread/thread.hpp&gt; #define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN using namespace std; int main() { cout &lt;&lt; "!!!Hello World!!!" &lt;&lt; endl; // prints !!!Hello World!!! return 0; } </pre><p> This is the only lines in my file. I included <strong>C:\Boost\boost_1_52_0</strong>, added this library path : <strong>C:\Boost\boost_1_52_0\lib</strong> and thoose libraries : <strong>boost_system-mgw47-1_52</strong> <strong>boost_thread-mgw47-mt-sd-1_52</strong> </p> </blockquote> </blockquote> </blockquote> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Fri, 11 Jan 2013 23:53:46 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7817#comment:12 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7817#comment:12</guid> <description> <p> On 1.54, I would define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN by default as I don't see any regression on it. </p> <p> Unfortunately I don't think this merits the change in 1.53 given the advanced state of the release. </p> <p> Could I close this ticket then? </p> </description> <category>Ticket</category> </item> <item> <author>Barnabé Faliu <barnabe.faliu@…></author> <pubDate>Fri, 11 Jan 2013 23:55:20 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7817#comment:13 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7817#comment:13</guid> <description> <p> Yes you can close it ! Thanks again for your help </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sat, 12 Jan 2013 10:17:43 GMT</pubDate> <title>status changed; resolution set; milestone deleted https://svn.boost.org/trac10/ticket/7817#comment:14 https://svn.boost.org/trac10/ticket/7817#comment:14 <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> <p> Conclusion: I won't fix as an acceptable alternative exists. </p> Ticket