From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [committed] Remove a redundant condition check in tic6x-linux-tdep.c
Date: Fri, 30 Nov 2012 07:35:00 -0000 [thread overview]
Message-ID: <1354260922-13995-1-git-send-email-yao@codesourcery.com> (raw)
Hi,
When gdb is configured as target=tic6x-uclinux, and compiled with clang,
I get this warning:
gdb/tic6x-linux-tdep.c:66:19: error: comparison of unsigned expression >= 0 is always true [-Werror,-Wtautological-compare]
It is redundant to check 'REGNUM >= 0' as it is unsigned. The
following patch is to fix it. Committed.
gdb:
2012-11-30 Yao Qi <yao@codesourcery.com>
* tic6x-linux-tdep.c (tic6x_register_sigcontext_offset): Don't
check REGNUM >= 0.
---
gdb/tic6x-linux-tdep.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gdb/tic6x-linux-tdep.c b/gdb/tic6x-linux-tdep.c
index 3b96201..f4450c9 100644
--- a/gdb/tic6x-linux-tdep.c
+++ b/gdb/tic6x-linux-tdep.c
@@ -63,7 +63,7 @@ tic6x_register_sigcontext_offset (unsigned int regnum, struct gdbarch *gdbarch)
else if (regnum == TIC6X_B5_REGNUM || regnum == TIC6X_B5_REGNUM + 2
|| regnum == TIC6X_B5_REGNUM + 4)
return 4 * (regnum - TIC6X_B5_REGNUM + 19); /* B5, B7, B9 */
- else if (regnum >= 0 && regnum < TIC6X_A4_REGNUM)
+ else if (regnum < TIC6X_A4_REGNUM)
return 4 * (regnum - 0 + 8); /* A0 - A3 */
else if (regnum >= TIC6X_B0_REGNUM && regnum < TIC6X_B4_REGNUM)
return 4 * (regnum - TIC6X_B0_REGNUM + 15); /* B0 - B3 */
--
1.7.7.6
next reply other threads:[~2012-11-30 7:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-30 7:35 Yao Qi [this message]
2012-11-30 12:22 ` Mark Kettenis
2012-11-30 14:11 ` Yao Qi
2012-12-05 18:30 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1354260922-13995-1-git-send-email-yao@codesourcery.com \
--to=yao@codesourcery.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox