public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/50356] New: Poor if condition in h8300 config code
@ 2011-09-11 16:57 dcb314 at hotmail dot com
  2012-10-04  9:21 ` [Bug target/50356] " manu at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: dcb314 at hotmail dot com @ 2011-09-11 16:57 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50356

             Bug #: 50356
           Summary: Poor if condition in h8300 config code
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: dcb314@hotmail.com


I just tried the cppcheck tool over the source code of
gcc 4.7 snapshot 20110910.

The tool said

[gcc/config/h8300/h8300.c:1209]: (warning) Mutual exclusion over || always
evaluates to true. Did you intend to use && instead?

The source code is

   if (-4 <= n || n <= 4)

Maybe better code might be

   if (-4 <= n && n <= 4)


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

end of thread, other threads:[~2012-10-04 20:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-11 16:57 [Bug target/50356] New: Poor if condition in h8300 config code dcb314 at hotmail dot com
2012-10-04  9:21 ` [Bug target/50356] " manu at gcc dot gnu.org
2012-10-04 19:05 ` law at redhat dot com
2012-10-04 20:58 ` law at gcc dot gnu.org
2012-10-04 20:59 ` law at redhat dot com

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).