[Boost-bugs] [Boost C++ Libraries] #3381: Compiler warning for is_signed

Subject: [Boost-bugs] [Boost C++ Libraries] #3381: Compiler warning for is_signed
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-09-01 07:42:14


#3381: Compiler warning for is_signed
------------------------------+---------------------------------------------
 Reporter: rbock@… | Owner: johnmaddock
     Type: Bugs | Status: new
Milestone: Boost 1.41.0 | Component: type_traits
  Version: Boost 1.40.0 | Severity: Problem
 Keywords: |
------------------------------+---------------------------------------------
 Hi,

 with g++ 4.2.4, I get the following warning when using
 boost::is_signed<long long unsigned int> with -Wall -Wextra:

 type_traits/is_signed.hpp:33: warning: comparison of unsigned expression <
 0 is always false

 I fixed this for myself by replacing

 (static_cast<no_cv_t>(-1) < 0)

 by

 !(static_cast<no_cv_t>(-1) > 0)

 Regards,

 Roland

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