Re: [Boost-bugs] [Boost C++ Libraries] #7814: Signal 6 coredump on lexical_cast with gcc option trapv

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7814: Signal 6 coredump on lexical_cast with gcc option trapv
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-12-23 15:50:56


#7814: Signal 6 coredump on lexical_cast with gcc option trapv
------------------------------------------------+---------------------------
  Reporter: Bernd Raum <braum@…> | Owner: apolukhin
      Type: Bugs | Status: assigned
 Milestone: To Be Determined | Component: lexical_cast
   Version: Boost 1.51.0 | Severity: Problem
Resolution: | Keywords: lexical_cast long trapv core dump
------------------------------------------------+---------------------------

Comment (by apolukhin):

 Replying to [comment:4 alexey kutumov <alexey.kutumov@…>]:
> Replying to [comment:3 apolukhin]:
> > Fast fixes did not help, because even some functions from std
 namespace trigger coredump.
>
> Could you give example (related to lexical_cast) when coredump occurs

 It was some code like:
 {{{
 template <class T>
 void test_impl() {
     typedef std::numeric_limits<T> limits;
     boost::lexical_cast<std::string>((limits::min)());
     boost::lexical_cast<std::string>((limits::max)());
     // boost::lexical_cast<T>("lexical representation of limits::min or
 limits::max");
 }

 int main() {
     test_impl<int>();
     test_impl<unsigned int>();
     boost::lexical_cast<int>(0.0f); // Fails only on `clang -ftrapv`
 }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7814#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:11 UTC