Boost C++ Libraries: Ticket #4574: boost/asio/detail/impl/win_mutex.ipp:57: return value of InitializeCriticalSectionAndSpinCount ignored, causing warning C6031 https://svn.boost.org/trac10/ticket/4574 <p> As of <a class="changeset" href="https://svn.boost.org/trac10/changeset/64932" title="Worked around annoying &#34;deprecated&#34; warnings on MSVC.">r64932</a> file boost/asio/detail/impl/win_mutex.ipp at function win_mutex::do_init, there is a call to <a class="missing wiki">InitializeCriticalSectionAndSpinCount</a> for which the return value is not checked. This causes warning C6031 from the Microsoft code analysis tool PREfast included with Visual Studio 2008, because someone at Microsoft marked that this function should always be checked. Since Boost already returns a Windows error code from this function if an exception is caught, I suggest returning the value of <a class="missing wiki">GetLastError</a>() if <a class="missing wiki">InitializeCriticalSectionAndSpinCount</a> fails. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4574 Trac 1.4.3 chris_kohlhoff Sat, 16 Oct 2010 10:01:23 GMT <link>https://svn.boost.org/trac10/ticket/4574#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4574#comment:1</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/66009" title="Check return code of InitializeCriticalSectionAndSpinCount. Refs #4574. ">[66009]</a>) Check return code of <a class="missing wiki">InitializeCriticalSectionAndSpinCount</a>. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4574" title="#4574: Bugs: boost/asio/detail/impl/win_mutex.ipp:57: return value of ... (closed: fixed)">#4574</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Sun, 17 Oct 2010 12:25:02 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4574#comment:2 https://svn.boost.org/trac10/ticket/4574#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/66037" title="Merge from trunk. ........ r65998 | chris_kohlhoff | 2010-10-16 ...">[66037]</a>) Merge from trunk. </p> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/65998" title="Make unit tests build faster. ">r65998</a> | chris_kohlhoff | 2010-10-16 15:30:12 +1100 (Sat, 16 Oct 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Make unit tests build faster. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/66002" title="Add a test case for bug where a deadline timer never fires if the ...">r66002</a> | chris_kohlhoff | 2010-10-16 16:13:46 +1100 (Sat, 16 Oct 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Add a test case for bug where a deadline timer never fires if the io_service is run in a background thread. N.B. fails only on platforms that use kqueue. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4568" title="#4568: Bugs: deadline_timer stop at boost-1.4.4 (closed: fixed)">#4568</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/66004" title="Fix the way the kqueue_reactor is interrupted when a new timer is ...">r66004</a> | chris_kohlhoff | 2010-10-16 16:43:03 +1100 (Sat, 16 Oct 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Fix the way the kqueue_reactor is interrupted when a new timer is scheduled. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4568" title="#4568: Bugs: deadline_timer stop at boost-1.4.4 (closed: fixed)">#4568</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/66005" title="Fix a const-correctness issue that prevents valid uses of ...">r66005</a> | chris_kohlhoff | 2010-10-16 17:27:45 +1100 (Sat, 16 Oct 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Fix a const-correctness issue that prevents valid uses of has_service&lt;&gt; from compiling. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4638" title="#4638: Bugs: Compile error using boost::asio::has_service() (closed: fixed)">#4638</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/66006" title="Use lower-case to keep MinGW cross-compilers happy. Refs #4491. ">r66006</a> | chris_kohlhoff | 2010-10-16 18:06:18 +1100 (Sat, 16 Oct 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Use lower-case to keep MinGW cross-compilers happy. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4491" title="#4491: Bugs: asio : WinError.h case incorrect ? (closed: fixed)">#4491</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/66007" title="Don't use deprecated system functions. Refs #4672. ">r66007</a> | chris_kohlhoff | 2010-10-16 18:24:47 +1100 (Sat, 16 Oct 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Don't use deprecated system functions. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4672" title="#4672: Bugs: asio uses deprecated functions from Boost.System (closed: fixed)">#4672</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/66008" title="Ensure close()/closesocket() failures are correctly propagated. Refs ...">r66008</a> | chris_kohlhoff | 2010-10-16 20:47:11 +1100 (Sat, 16 Oct 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Ensure close()/closesocket() failures are correctly propagated. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4573" title="#4573: Bugs: boost/asio/detail/impl/socket_ops.ipp:315: int 'result' shadows ... (closed: fixed)">#4573</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/66009" title="Check return code of InitializeCriticalSectionAndSpinCount. Refs #4574. ">r66009</a> | chris_kohlhoff | 2010-10-16 21:01:14 +1100 (Sat, 16 Oct 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Check return code of <a class="missing wiki">InitializeCriticalSectionAndSpinCount</a>. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4574" title="#4574: Bugs: boost/asio/detail/impl/win_mutex.ipp:57: return value of ... (closed: fixed)">#4574</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/66010" title="Add support for hardware flow control on QNX. Refs #4625. ">r66010</a> | chris_kohlhoff | 2010-10-16 22:04:08 +1100 (Sat, 16 Oct 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Add support for hardware flow control on QNX. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4625" title="#4625: Patches: Can't set or unset serial hardware flow control on QNX (closed: fixed)">#4625</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/66014" title="Always use pselect() on HP-UX, if it is available. Refs #4578. ">r66014</a> | chris_kohlhoff | 2010-10-16 22:39:13 +1100 (Sat, 16 Oct 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Always use pselect() on HP-UX, if it is available. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4578" title="#4578: Patches: asio: always use pselect() on hpux11.31 over select() (closed: fixed)">#4578</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/66017" title="Ensure handler arguments are passed as lvalues. Refs #4744. ">r66017</a> | chris_kohlhoff | 2010-10-16 23:23:56 +1100 (Sat, 16 Oct 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Ensure handler arguments are passed as lvalues. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4744" title="#4744: Bugs: Some handler arguments are not passed as lvalues (closed: fixed)">#4744</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/66018" title="Fix Windows build when thread support is disabled. Refs #4680. ">r66018</a> | chris_kohlhoff | 2010-10-16 23:39:06 +1100 (Sat, 16 Oct 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Fix Windows build when thread support is disabled. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4680" title="#4680: Bugs: error asio compilation with BOOST_ASIO_DISABLE_THREADS (closed: fixed)">#4680</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/66020" title="Timers with expiry times set more than 5 minutes in the future need ...">r66020</a> | chris_kohlhoff | 2010-10-16 23:59:29 +1100 (Sat, 16 Oct 2010) | 3 lines </p> </blockquote> <p> </p> <blockquote> <p> Timers with expiry times set more than 5 minutes in the future need the waitable timer to be periodic. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4745" title="#4745: Bugs: On Windows, timers that expire more than 5 minutes in the future may ... (closed: fixed)">#4745</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/66035" title="Version bump. ">r66035</a> | chris_kohlhoff | 2010-10-17 22:33:28 +1100 (Sun, 17 Oct 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Version bump. </p> </blockquote> <p> ........ </p> Ticket Marshall Clow Thu, 14 Apr 2011 15:52:02 GMT <link>https://svn.boost.org/trac10/ticket/4574#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4574#comment:3</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/71249" title="Merge fixes to release; Fixes #4411 Fixes #4574">[71249]</a>) Merge fixes to release; Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4411" title="#4411: Patches: date_time missing &#34;Australia/Eucla&#34; time zone (closed: fixed)">#4411</a> Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4574" title="#4574: Bugs: boost/asio/detail/impl/win_mutex.ipp:57: return value of ... (closed: fixed)">#4574</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Thu, 14 Apr 2011 16:10:03 GMT</pubDate> <title>status changed; resolution deleted https://svn.boost.org/trac10/ticket/4574#comment:4 https://svn.boost.org/trac10/ticket/4574#comment:4 <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">fixed</span> </li> </ul> <p> Damn. Fat-fingered a svn commit message. </p> <p> Commit <a class="changeset" href="https://svn.boost.org/trac10/changeset/71249" title="Merge fixes to release; Fixes #4411 Fixes #4574">[71249]</a> fixed <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4754" title="#4754: Patches: australian daylight savings time start/end dates are wrong (closed: fixed)">#4754</a>, not this ticket. </p> Ticket chris_kohlhoff Mon, 06 Jun 2011 01:25:10 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/4574#comment:5 https://svn.boost.org/trac10/ticket/4574#comment:5 <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> Ticket was inadvertently reopened. </p> Ticket