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/77292] value range propagation (VRP) would improve -Wlogical-not-parentheses


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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |SUSPENDED
   Last reconfirmed|                            |2016-08-19
                 CC|                            |manu at gcc dot gnu.org
            Summary|Spurious "warning: logical  |value range propagation
                   |not is only applied to the  |(VRP) would improve
                   |left hand side of           |-Wlogical-not-parentheses
                   |comparison"                 |
     Ever confirmed|0                           |1

--- Comment #4 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
Note that Clang suggests two ways to silence the warning:

prog.cc:9:10: note: add parentheses after the '!' to evaluate the comparison
first
  return !a == b;
         ^
          (     )
prog.cc:9:10: note: add parentheses around left hand side expression to silence
this warning
  return !a == b;
         ^
         ( )


Also, we do not warn for actual booleans (bool).

To be able to not warn based on the runtime range of variables, we would need
something like VRP in the FE, and that is unlikely to be implemented in the
medium future.

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