Re: [Boost-bugs] [Boost C++ Libraries] #7272: win32/thread_primitives.hpp: (Unneccessary) Warning

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7272: win32/thread_primitives.hpp: (Unneccessary) Warning
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-09-28 21:37:33


#7272: win32/thread_primitives.hpp: (Unneccessary) Warning
-----------------------------------------+----------------------------------
  Reporter: christian.buss@… | Owner: viboes
      Type: Patches | Status: reopened
 Milestone: Boost 1.52.0 | Component: thread
   Version: Boost 1.51.0 | Severity: Problem
Resolution: | Keywords:
-----------------------------------------+----------------------------------
Changes (by gix):

  * status: closed => reopened
  * resolution: fixed =>
  * severity: Cosmetic => Problem

Comment:

 The warning reported by ICL points at a serious bug. Changesets [80203]
 and [80235] only silence the warning.

 ICL seems to only accept newlines as separator between asm instructions
 and only emits "mov eax,bit", which makes interlocked_bit_test_and_set
 return an ret uninitialized.

 Running the attached test case:
 {{{
 $ icl -nologo -EHsc boost-7272.cpp && boost-7272.exe
 boost-7272.cpp
 Testing bit 0 of x=3
 result: 0 (expected: 1)
 x: 3 (expected: 3)
 Testing bit 2 of x=3
 result: 0 (expected: 0)
 x: 3 (expected: 7)
 }}}

 As a comparison, here with MSVC:
 {{{
 D:\>cl -nologo -EHsc boost-7272.cpp && boost-7272.exe
 boost-7272.cpp
 Testing bit 0 of x=3
 result: 1 (expected: 1)
 x: 3 (expected: 3)
 Testing bit 2 of x=3
 result: 0 (expected: 0)
 x: 7 (expected: 7)
 }}}

 Putting each instruction on a separate line (with and without trailing
 ";") fixes this.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7272#comment:6>
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:10 UTC