Opened 11 years ago

Closed 11 years ago

#1640 closed Bugs (fixed)

[Thread] warnings from VC9 + warning level 4

Reported by: Richard Webb <richard.webb@…> Owned by: Anthony Williams
Milestone: To Be Determined Component: thread
Version: Boost Development Trunk Severity: Cosmetic
Keywords: Cc:

Description

Running the Thread tests with VC9 on warning level 4 produces some warnings:

boost/thread/win32/condition_variable.hpp(111) : warning C4512: 'boost::detail::basic_condition_variable::relocker<lock_type>' : assignment operator could not be generated
boost/thread/detail/move.hpp(25) : warning C4512: 'boost::detail::thread_move_t<T>' : assignment operator could not be generated
boost/thread/win32/once.hpp(49) : warning C4512: 'boost::detail::win32_mutex_scoped_lock' : assignment operator could not be generated

boost\thread\win32\basic_timed_mutex.hpp(67) : warning C4127: conditional expression is constant

boost/thread/win32/thread.hpp(182) : warning C4251: 'boost::thread::thread_info_mutex' : class 'boost::mutex' needs to have dll-interface to be used by clients of class 'boost::thread'
boost/thread/win32/thread.hpp(183) : warning C4251: 'boost::thread::thread_info' : class 'boost::intrusive_ptr<T>' needs to have dll-interface to be used by clients of class 'boost::thread'

There are also some warnings from the tests themselves:

libs\thread\test\condition_test_common.hpp(37) : warning C4512: 'wait_for_flag::check_flag' : assignment operator could not be generated
libs/thread/test/util.inl(170) : warning C4512: '`anonymous-namespace'::thread_member_binder<R,T>' : assignment operator could not be generated
libs/thread/test/util.inl(126) : warning C4512: '`anonymous-namespace'::indirect_adapter<F>' : assignment operator could not be generated
libs\thread\test\shared_mutex_locking_thread.hpp(59) : warning C4512: 'locking_thread<lock_type>' : assignment operator could not be generated

test_shared_mutex_part_2.cpp(139) : warning C4512: '`anonymous-namespace'::simple_writing_thread' : assignment operator could not be generated
test_shared_mutex_part_2.cpp(205) : warning C4512: '`anonymous-namespace'::simple_reading_thread' : assignment operator could not be generated

Attached is a patch that silences the 4512 warning from the public headers by adding private assignment operators. I think the 4251 warnings can only be silenced by turing off the warnings with a pragma.

Attachments (1)

thread4512.patch (1.1 KB) - added by Richard Webb <richard.webb@…> 11 years ago.

Download all attachments as: .zip

Change History (2)

Changed 11 years ago by Richard Webb <richard.webb@…>

Attachment: thread4512.patch added

comment:1 Changed 11 years ago by Anthony Williams

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.