Subject: [Boost-bugs] [Boost C++ Libraries] #6060: Warning generated in SNC C++ compiler by use of __sync_fetch_and_add
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-10-25 20:30:25
#6060: Warning generated in SNC C++ compiler by use of __sync_fetch_and_add
----------------------------------------------+-----------------------------
Reporter: Fernando Diaz <fdiaza@â¦> | Owner: pdimov
Type: Patches | Status: new
Milestone: To Be Determined | Component: smart_ptr
Version: Boost 1.47.0 | Severity: Optimization
Keywords: |
----------------------------------------------+-----------------------------
When compiling code that uses boost/shared_array.hpp in SNC C++ compiler,
the following warning is generated:
../../SDKs/Boost/boost/smart_ptr/detail/sp_counted_base_sync.hpp(48,37):
warning 68: integer conversion resulted in a change of sign
in this line:
{{{
return __sync_fetch_and_add( pw, -1 );
}}}
I've managed to fix the warning by replacing "__sync_fetch_and_add" with
"__sync_fetch_and_sub", and changing the second argument from "-1" to "1".
I've included a patch, hope it helps.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6060> 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:07 UTC