Subject: [Boost-bugs] [Boost C++ Libraries] #4574: boost/asio/detail/impl/win_mutex.ipp:57: return value of InitializeCriticalSectionAndSpinCount ignored, causing warning C6031
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-08-19 21:40:48
#4574: boost/asio/detail/impl/win_mutex.ipp:57: return value of
InitializeCriticalSectionAndSpinCount ignored, causing warning C6031
------------------------------+---------------------------------------------
Reporter: anonymous | Owner: chris_kohlhoff
Type: Bugs | Status: new
Milestone: To Be Determined | Component: asio
Version: Boost 1.44.0 | Severity: Problem
Keywords: |
------------------------------+---------------------------------------------
As of r64932 file boost/asio/detail/impl/win_mutex.ipp at function
win_mutex::do_init, there is a call to
InitializeCriticalSectionAndSpinCount 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 GetLastError() if
InitializeCriticalSectionAndSpinCount fails.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/4574> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:04 UTC