Subject: [Boost-bugs] [Boost C++ Libraries] #9596: "logical âandâ of mutually exclusive tests is always false" error in random/linear_congruential.hpp
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-01-20 14:57:00
#9596: "logical âandâ of mutually exclusive tests is always false" error in
random/linear_congruential.hpp
------------------------------+---------------------------
Reporter: a0smucig@⦠| Owner: no-maintainer
Type: Patches | Status: new
Milestone: To Be Determined | Component: random
Version: Boost 1.55.0 | Severity: Optimization
Keywords: |
------------------------------+---------------------------
There is a line in random/linear_congruential.hpp at line 136 which seems
to work, but may be a bit wrong. It may definitely be my somewhat small
knowledge of how the compiler works, but shouldn't this: if(_x <= 0 && _x
!= 0) be equal to if(_x < 0). This line throws an error with the -Werror
flag set in gcc 4.7.2: with "logical âandâ of mutually exclusive tests is
always false [-Werror=logical-op]". These are not mutually exclusive, so
the compiler may be wrong, but the question still remains if this could be
done better.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/9596> 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:15 UTC