Opened 7 years ago

Closed 7 years ago

#11765 closed Bugs (fixed)

boost_1_59_0/boost/intrusive/sgtree.hpp:830: bad if test ?

Reported by: David Binderman <dcb314@…> Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: intrusive
Version: Boost 1.59.0 Severity: Problem
Keywords: Cc: dcb314@…

Description

[boost_1_59_0/boost/intrusive/sgtree.hpp:830]: (warning) Logical conjunction always evaluates to false: new_alpha < 0.5f && new_alpha >= 1.0f.

Source code is

if(new_alpha < 0.5f && new_alpha >= 1.0f) return;

Maybe better code

if(new_alpha < 0.5f
new_alpha >= 1.0f) return;

Compiling with gcc flag -Wlogical-op might help find further examples of this problem.

Change History (2)

comment:1 by viboes, 7 years ago

Component: Noneintrusive
Owner: set to Ion Gaztañaga

comment:2 by Ion Gaztañaga, 7 years ago

Resolution: fixed
Status: newclosed

Thanks for the report. It seems that -Wlogical-op is not part of -Wall due to some false positives. Fixed in:

https://github.com/boostorg/intrusive/commit/259e4a939f3b69c79cd136d87f9f6479deb98104

Note: See TracTickets for help on using tickets.