Opened 10 years ago
Closed 10 years ago
#7765 closed Bugs (duplicate)
Warnings from shared_mutex.hpp when including thread.hpp
Reported by: | Owned by: | viboes | |
---|---|---|---|
Milestone: | To Be Determined | Component: | thread |
Version: | Boost 1.52.0 | Severity: | Problem |
Keywords: | Cc: |
Description (last modified by )
Just by including <boost/thread/thread.hpp>, when I compile my program I get thoose warnings:
'''C:\Boost\boost_1_52_0/boost/thread/win32/shared_mutex.hpp: In instantiation of 'T boost::shared_mutex::interlocked_compare_exchange(T*, T, T) [with T = boost::shared_mutex::state_data]': C:\Boost\boost_1_52_0/boost/thread/win32/shared_mutex.hpp:124:103: required from here C:\Boost\boost_1_52_0/boost/thread/win32/shared_mutex.hpp:52:99: warning: dereferencing type-punned pointer will break strict-aliasing rules C:\Boost\boost_1_52_0/boost/thread/win32/shared_mutex.hpp:52:99: warning: dereferencing type-punned pointer will break strict-aliasing rules C:\Boost\boost_1_52_0/boost/thread/win32/shared_mutex.hpp:53:52: warning: dereferencing type-punned pointer will break strict-aliasing rules C:\Boost\boost_1_52_0/boost/thread/win32/shared_mutex.hpp:53:52: warning: dereferencing type-punned pointer will break strict-aliasing rules'''
Help please !
Change History (8)
follow-up: 2 comment:1 by , 10 years ago
comment:2 by , 10 years ago
Just want to add that i just tested it with g++ 4.7.2 and with and without -std=gnu++11 flag. Problem appears consistently.
comment:3 by , 10 years ago
Component: | None → thread |
---|---|
Description: | modified (diff) |
Milestone: | Boost 1.52.0 → To Be Determined |
Owner: | set to |
Status: | new → assigned |
comment:4 by , 10 years ago
Please, could you tell me if the warnings appear when you define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN?
comment:5 by , 10 years ago
Resolution: | → duplicate |
---|---|
Status: | assigned → closed |
Duplicated from #7817 as it contains more warnings.
comment:6 by , 10 years ago
It does appear even if i define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN !!
comment:7 by , 10 years ago
Resolution: | duplicate |
---|---|
Status: | closed → reopened |
Reopened as BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN will not be defined by default and as #7906 states there is a lost in performances when this define is defined.
comment:8 by , 10 years ago
Resolution: | → duplicate |
---|---|
Status: | reopened → closed |
Hi, I have the same problem. Windows 7 64-bit, MinGW (g++ 4.7.0). Boost 1.52.
I'm writing here because i noticed that this error (warnings) do not appear with O0 and O1 flags but they do with O2 and O3. Maybe that helps.
Whats more the program compiles and works without any problems (though my application is not very complex).