Re: [Boost-bugs] [Boost C++ Libraries] #6126: Signed integer members of Boost.Fusion adapted ADTs are not output correctly with Boost.Spirit.Karma rules

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #6126: Signed integer members of Boost.Fusion adapted ADTs are not output correctly with Boost.Spirit.Karma rules
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-12-29 10:38:18


#6126: Signed integer members of Boost.Fusion adapted ADTs are not output
correctly with Boost.Spirit.Karma rules
-------------------------------+--------------------------------------------
  Reporter: t0rt1e@… | Owner: hkaiser
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: spirit
   Version: Boost 1.48.0 | Severity: Problem
Resolution: | Keywords: Boost.Spirit.Karma, Boost.Fusion, BOOST_FUSION_ADAPT_CLASS, BOOST_FUSION_ADAPT_ADT, short, int, long
-------------------------------+--------------------------------------------

Comment (by t0rt1e@…):

 I can help with the clang++ output:
 {{{
 $ clang++ --versionApple clang version 3.0 (tags/Apple/clang-211.12)
 (based on LLVM 3.0svn)Target: x86_64-apple-darwin11.2.0
 Thread model: posix
 $ clang++ -o test_signed_integer_output_with_karma_minimal \
 test_signed_integer_output_with_karma_minimal.cpp \
 -I/Users/maehne/Build/boost-trunk/ maehne_at_epsilon3:Boost
 $ ./test_signed_integer_output_with_karma_minimal
 rational_int_adt(2, -6) = -32767/3 (expected: -1/3)
 rational_int_adt(-2, 4) = -32767/2 (expected: -1/2)
 rational_int_struct(2, -6) = 2/-6 (expected: 2/-6)
 $ clang++ -O2 -o test_signed_integer_output_with_karma_minimal \
 test_signed_integer_output_with_karma_minimal.cpp \
 -I/Users/maehne/Build/boost-trunk/
 $ ./test_signed_integer_output_with_karma_minimal
 rational_int_adt(2, -6) = 0/0 (expected: -1/3)
 rational_int_adt(-2, 4) = 0/0 (expected: -1/2)
 rational_int_struct(2, -6) = 2/-6 (expected: 2/-6)
 }}}
 So, also for clang++ the results depend on the optimization settings.

 That would be great if you've found the culprit! The
 compiler/optimization-dependent output also made me think of some
 undefined behavior to be triggered by the C++ code, but, unfortunately,
 I'm not familiar enough with the Boost.Fusion and Boost.Spirit codebase
 to hunt it down. Thanks a lot for investing so much effort to analyze
 and resolve the bug! If you need help to test the patch, I can try it
 out on my side with my production code.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6126#comment:5>
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:08 UTC