Opened 13 years ago
Closed 13 years ago
#3381 closed Bugs (fixed)
Compiler warning for is_signed
Reported by: | Owned by: | John Maddock | |
---|---|---|---|
Milestone: | Boost 1.41.0 | Component: | type_traits |
Version: | Boost 1.40.0 | Severity: | Problem |
Keywords: | Cc: |
Description
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
Note:
See TracTickets
for help on using tickets.
(In [55957]) Fix warnings emitted by gcc when building with -Wall -Wextra. Fixes #3381.