Opened 7 years ago

Last modified 5 years ago

#12104 assigned Bugs

windows - Visual Studio 2015 Update 2 RC gives out warning C4191 in thread_primitive.hpp

Reported by: Shane Mathews (oneZero Financial Systems) <smathews@…> Owned by: viboes
Milestone: To Be Determined Component: thread
Version: Boost 1.60.0 Severity: Problem
Keywords: Cc:

Description (last modified by viboes)

thread/win32/thread_primitives.hpp(312): warning C4191: 'type cast': unsafe conversion from 'boost::detail::win32::farproc_t' to 'boost::detail::win32::detail::gettickcount64_t'

Calling this function through the result pointer may cause your program to fail

Change History (8)

comment:1 by kline.christopher@…, 7 years ago

I am able to reproduce this as well, when doing

#include <boost/thread/mutex.hpp>

within a .cpp that uses boost::lock_guard<boost::mutex>

under Visual Studio 2015 Update 2 RTM

comment:2 by viboes, 6 years ago

Owner: changed from Anthony Williams to viboes
Status: newassigned

comment:3 by viboes, 6 years ago

Hi, I don't see how to fix this.

comment:4 by viboes, 6 years ago

Description: modified (diff)

comment:5 by chfast@…, 6 years ago

I hit the same bug.

The workaround is to try including <boost/thread> before <thread>.

comment:6 by viboes, 5 years ago

Could you post an example that produce the error?

comment:7 by viboes, 5 years ago

Summary: Visual Studio 2015 Update 2 RC gives out warning C4191 in thread_primitive.hppwindows - Visual Studio 2015 Update 2 RC gives out warning C4191 in thread_primitive.hpp

comment:8 by viboes, 5 years ago

This file has changed a lot since Boost.Thread has moved to Boost.WinApi.

Please, let me know if those changes solve the issue and we can close it.

Note: See TracTickets for help on using tickets.