public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/61271] New: 3 * possible coding error with logical not (!)
@ 2014-05-21 14:01 dcb314 at hotmail dot com
  2014-05-21 14:20 ` [Bug c/61271] " dcb314 at hotmail dot com
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: dcb314 at hotmail dot com @ 2014-05-21 14:01 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61271
           Summary: 3 * possible coding error with logical not (!)
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com

I just compiled gcc trunk 20140521 with boot compiler clang++ -g -O2 -Wall
and it said

1.

../../src/trunk/gcc/cgraphunit.c:1182:8: warning: logical not is only applied
to the left hand side of this comparison [-Wlogical-not-parentheses]

Source code is

      && (! TREE_CODE (target_node->decl) == FUNCTION_DECL

Maybe

      && (TREE_CODE (target_node->decl) != FUNCTION_DECL)

was intended.

2.

../../src/trunk/gcc/config/i386/i386.c:37905:10: warning: logical not is only
applied to the left hand side of this comparison [-Wlogical-not-parentheses]

Source code is

           || (!GET_CODE (x) != LABEL_REF

Confusing with the double negative. Maybe

           || (GET_CODE (x) == LABEL_REF

was intended.

3.

../../src/trunk/gcc/cp/cp-array-notation.c:1420:7: warning: logical not is only
applied to the left hand side of this comparison [-Wlogical-not-parentheses]

Source code is

  if (!TREE_CODE (type) == FUNCTION_TYPE)
    {
      error_at (loc, "array notation cannot be used with function type");
      return false;
    }

Maybe

  if (TREE_CODE (type) == FUNCTION_TYPE)
    {
      error_at (loc, "array notation cannot be used with function type");
      return false;
    }

was intended.


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2014-09-01 10:17 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-21 14:01 [Bug c/61271] New: 3 * possible coding error with logical not (!) dcb314 at hotmail dot com
2014-05-21 14:20 ` [Bug c/61271] " dcb314 at hotmail dot com
2014-05-21 14:31 ` [Bug c/61271] 6 " redi at gcc dot gnu.org
2014-05-21 14:33 ` dcb314 at hotmail dot com
2014-05-21 16:12 ` [Bug c/61271] 10 " manu at gcc dot gnu.org
2014-05-22 12:17 ` redi at gcc dot gnu.org
2014-05-26 17:33 ` uros at gcc dot gnu.org
2014-05-29  8:16 ` uros at gcc dot gnu.org
2014-06-04  8:30 ` manu at gcc dot gnu.org
2014-08-19 11:36 ` mpolacek at gcc dot gnu.org
2014-08-22 19:41 ` mpolacek at gcc dot gnu.org
2014-08-26  9:21 ` mpolacek at gcc dot gnu.org
2014-08-26  9:26 ` mpolacek at gcc dot gnu.org
2014-08-26  9:31 ` mpolacek at gcc dot gnu.org
2014-08-26  9:31 ` mpolacek at gcc dot gnu.org
2014-08-26  9:35 ` mpolacek at gcc dot gnu.org
2014-08-26 14:25 ` mpolacek at gcc dot gnu.org
2014-09-01  9:32 ` mpolacek at gcc dot gnu.org
2014-09-01 10:07 ` mpolacek at gcc dot gnu.org
2014-09-01 10:12 ` mpolacek at gcc dot gnu.org
2014-09-01 10:15 ` mpolacek at gcc dot gnu.org
2014-09-01 10:17 ` mpolacek at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).