This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/64609] No -Wbool-compare warning on "(a = 0 && 0) <= 4"


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64609

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
It's because we get rid of that && 0 prior calling maybe_warn_bool_compare. 
But we warn for

int
fn1 (int a, int b)
{
  return ((a && b) <= 4);
}

warning: comparison of constant ‘4’ with boolean expression is always true

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]