This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/77292] Spurious warning: logical not is only applied to the left hand side of comparison
- From: "segher at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 19 Aug 2016 16:35:16 +0000
- Subject: [Bug c/77292] Spurious warning: logical not is only applied to the left hand side of comparison
- Authentication-results: sourceware.org; auth=none
- Auto-submitted: auto-generated
- References: <bug-77292-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77292
--- Comment #13 from Segher Boessenkool <segher at gcc dot gnu.org> ---
(In reply to Manuel López-Ibáñez from comment #12)
> (In reply to Segher Boessenkool from comment #11)
> > Both of these suggestions are not so good. "!(a == b)" is better written
> > as "a != b", and "!(a) == b" is just horrible.
>
> Agreed for the former, but the latter is suggesting (!a) == b, which is IMHO
> clearer than ! a == b.
Ah. The parens are placed suggestively around the "a" in the suggestion, so
it is misleading even :-/ (Or maybe I'm just not very good at reading).