https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106455
Bug ID: 106455 Summary: bad style: comparatives over booleans ? Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: dcb314 at hotmail dot com Target Milestone: --- Static analyser cppcheck says for recent gcc trunk: trunk.git/gcc/sreal.h:72:25: style: Comparison of a variable having boolean value using relational (<, >, <= or >=) operator. [comparisonOfBoolWithBoolError] Source code is bool negative = m_sig < 0; bool other_negative = other.m_sig < 0; if (negative != other_negative) return negative > other_negative; I agree - this looks bad style to me. I don't think > should work on booleans.