Boost C++ Libraries: Ticket #11338: mingw warnings https://svn.boost.org/trac10/ticket/11338 <p> Since a long time ago I get the following warning (and others similar to this) </p> <p> C:/SupercolliderRepos/scfork/supercollider/external_libraries/boost/boost/detail/winapi/synchronization.hpp:195:66: warning: declaration of 'void* boost::detail::winapi::CreateEventA(boost::detail::winapi::_SECURITY_ATTRIBUTES*, boost::detail::winapi ::BOOL_, boost::detail::winapi::BOOL_, boost::detail::winapi::LPCSTR_)' with C language linkage [enabled by default] </p> <blockquote> <p> CreateEventA(_SECURITY_ATTRIBUTES*, BOOL_, BOOL_, LPCSTR_); </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> In file included from C:/SupercolliderRepos/scfork/supercollider/external_libraries/boost/boost/thread/win32/shared_mutex.hpp :13:0, </p> <blockquote> <p> from C:/SupercolliderRepos/scfork/supercollider/external_libraries/boost/boost/thread/shared_mutex.hpp:18, from C:/SupercolliderRepos/scfork/supercollider/external_libraries/nova-tt/nova-tt/rw_mutex.hpp:27, from C:/SupercolliderRepos/scfork/supercollider/server/supernova/./utilities/named_hash_entry.hpp:27, from C:/SupercolliderRepos/scfork/supercollider/server/supernova/./server/synth_definition.hpp:29, from C:/SupercolliderRepos/scfork/supercollider/server/supernova/./server/node_types.hpp:28, from C:/SupercolliderRepos/scfork/supercollider/server/supernova/./server/synth.hpp:27, from C:\<a class="missing wiki">SupercolliderRepos</a>\scfork\supercollider\server\supernova\server\dsp_thread_queue_node.hpp:27, from C:\<a class="missing wiki">SupercolliderRepos</a>\scfork\supercollider\server\supernova\server\node_graph.hpp:26, from C:\<a class="missing wiki">SupercolliderRepos</a>\scfork\supercollider\server\supernova\server\server.hpp:26, from C:\<a class="missing wiki">SupercolliderRepos</a>\scfork\supercollider\server\supernova\server\main.cpp:28: </p> </blockquote> <p> C:/SupercolliderRepos/scfork/supercollider/external_libraries/boost/boost/thread/win32/thread_primitives.hpp:166:55: warning: </p> <blockquote> <p> conflicts with previous declaration 'void* boost::detail::win32::CreateEventA(boost::detail::win32::_SECURITY_ATTRIBUTES*, i </p> </blockquote> <p> nt, int, const char*)' [enabled by default] </p> <blockquote> <p> <span class="underline">declspec(dllimport) void* </span>stdcall CreateEventA(_SECURITY_ATTRIBUTES*,int,int,char const*); </p> </blockquote> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11338 Trac 1.4.3 John Maddock Thu, 28 May 2015 16:13:02 GMT component changed; owner set https://svn.boost.org/trac10/ticket/11338#comment:1 https://svn.boost.org/trac10/ticket/11338#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Andrey Semashev</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">winapi</span> </li> </ul> Ticket Andrey Semashev Mon, 01 Jun 2015 07:51:22 GMT owner, component changed https://svn.boost.org/trac10/ticket/11338#comment:2 https://svn.boost.org/trac10/ticket/11338#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Andrey Semashev</span> to <span class="trac-author">viboes</span> </li> <li><strong>component</strong> <span class="trac-field-old">winapi</span> → <span class="trac-field-new">thread</span> </li> </ul> <p> IIRC, Boost.Thread developers were planning to port to the Boost.WinAPI declarations at some point. This would remove the discrepancies between the declarations and, I think, this would be the right solution. </p> Ticket Andrey Semashev Mon, 01 Jun 2015 09:18:34 GMT cc set https://svn.boost.org/trac10/ticket/11338#comment:3 https://svn.boost.org/trac10/ticket/11338#comment:3 <ul> <li><strong>cc</strong> <span class="trac-author">Andrey.Semashev@…</span> added </li> </ul> Ticket viboes Mon, 01 Jun 2015 17:10:20 GMT <link>https://svn.boost.org/trac10/ticket/11338#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11338#comment:4</guid> <description> <p> I have no access to a windows environment. </p> <p> I could create a branch and do my best to port to Boost.WinAPI if someone is ready to test it. </p> <p> I would also accept any working patch. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Edward Diener</dc:creator> <pubDate>Mon, 01 Jun 2015 21:17:59 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11338#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11338#comment:5</guid> <description> <p> I can test the changes made to Boost.WinAPI on Windows 7 and/or 8.1 using VC++ ( 8 through 12 ), gcc ( 4.3 through 4.9.2 ), and the latest clang. Just tell me what the git branch is and I will test it for you when you are finished with it. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Mon, 01 Jun 2015 21:26:38 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11338#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11338#comment:6</guid> <description> <p> Thanks, I will post it here. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Edward Diener</dc:creator> <pubDate>Tue, 02 Jun 2015 11:28:26 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11338#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11338#comment:7</guid> <description> <p> My clang bug report at <a class="ext-link" href="https://llvm.org/bugs/show_bug.cgi?id=23722"><span class="icon">​</span>https://llvm.org/bugs/show_bug.cgi?id=23722</a> came back with: </p> <p> The problem is that the two function declarations have different parameter types. The windows.h version takes ::_FILETIME*, whereas the boost version takes boost::detail::winapi::_FILETIME*. Because they're 'extern "C"' functions, they are redeclarations of the same function, and are ill-formed because they have different types. </p> <p> It looks like the only viable solution which will satisfy clang, and the C++ standard, is along the lines of what Peter Dimov suggested for all the winapi functionality: </p> <pre class="wiki">/* at global scope */ struct FILETIME; extern "C" __declspec(dllimport) void __stdcall GetSystemTimeAsFileTime(FILETIME*); namespace winapi { struct FILETIME { ... }; inline void GetSystemTimeAsFileTime( FILETIME * p ) { ::GetSystemTimeAsFileTime( (::FILETIME*)p ); } } </pre><p> and then calling: </p> <pre class="wiki"> boost::winapi::FILETIME ft; boost::winapi::GetSystemTimeAsFileTime(&amp;ft); </pre><p> is no problem for clang and the C++ standard. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Tue, 02 Jun 2015 11:46:56 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11338#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11338#comment:8</guid> <description> <p> We'll wait and see if the clang behavior is actually backed by the standard. </p> <p> I think Boost.Thread needs to be ported to Boost.WinAPI regardless of the clang issue, at least to remove duplication. We can deal with the clang issue in Boost.WinAPI, and once Boost.Thread is ported, the problem will be solved for it as well. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Edward Diener</dc:creator> <pubDate>Fri, 05 Jun 2015 09:47:25 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11338#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11338#comment:9</guid> <description> <p> The clang explanation is: </p> <p> [dcl.link]/6: "At most one function with a particular name can have C language linkage. Two declarations for a function with C language linkage with the same function name (ignoring the namespace names that qualify it) that appear in different namespace scopes refer to the same function." </p> <p> [basic.link]/10: "the types specified by all declarations referring to a given variable or function shall be identical" </p> <p> So the program is ill-formed because the same function is declared with two different types. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sun, 28 Jun 2015 09:10:36 GMT</pubDate> <title>status changed https://svn.boost.org/trac10/ticket/11338#comment:10 https://svn.boost.org/trac10/ticket/11338#comment:10 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket sonoro@… Tue, 16 Feb 2016 15:07:59 GMT <link>https://svn.boost.org/trac10/ticket/11338#comment:11 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11338#comment:11</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/11338#comment:10" title="Comment 10">viboes</a>: Is this still alive? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Tue, 14 Nov 2017 20:53:45 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11338#comment:12 https://svn.boost.org/trac10/ticket/11338#comment:12 <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">obsolete</span> </li> </ul> <p> Closed as Boost.Thread uses now Boost.<a class="missing wiki">WinApi</a> </p> Ticket