Re: [Boost-bugs] [Boost C++ Libraries] #10109: Wrong overflow checking with uint_parser<int>

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10109: Wrong overflow checking with uint_parser<int>
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-06-10 15:25:14


#10109: Wrong overflow checking with uint_parser<int>
----------------------------------------------+---------------------
  Reporter: Giulio Franco <giulio_franco@…> | Owner: djowel
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: spirit
   Version: Boost Release Branch | Severity: Problem
Resolution: | Keywords:
----------------------------------------------+---------------------

Comment (by djowel):

 You are requesting for a unit parser but you give it an int? uint_parser,
 for performance reasons, does not test for wrap around -- which is what
 happens here. it is assumed that your type T does not wrap around as int
 does. perhaps we should be strict and test it with a static assert
 instead, but there's no generic way to know if T does or does not wrap
 around. The alternative, that you seem to be suggesting is to check for
 wrap, but that would penalise the majority of uses.

 No this is not a bug. And I don't think it should be "fixed". The best we
 can do is document this precondition that T should not wrap around.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10109#comment:1>
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:16 UTC