Re: [Boost-bugs] [Boost C++ Libraries] #7679: unhex level 4 compile warning in visual studio

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7679: unhex level 4 compile warning in visual studio
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-11-11 03:05:15


#7679: unhex level 4 compile warning in visual studio
-----------------------------------------------+----------------------------
  Reporter: Gary Sanders <lex21@…> | Owner: marshall
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: algorithm
   Version: Boost 1.52.0 | Severity: Problem
Resolution: | Keywords: unhex
-----------------------------------------------+----------------------------

Comment (by marshall):

 This is a crap warning.

 There is no loss of data here.

 The routine `hex_char_to_int` only returns values in the range 0..15.

 With `T` == `char`, the loop at line 134 will be executed twice.

 `res` is initialized to zero.

 The first time through the loop, we multiply `res` (0) * 16 + add the
 result of `hex_char_to_int`, so the maximum value that `res` can be is
 15.

 The second time through the loop, we multiply `res` * 16 and add the
 result of `hex_char_to_int`, so the maximum value that `res` can be is
 (15*16) + 15, or 255.

 No overflow; no loss of data.

 Please file a bug report with your compiler vendor.

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