This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [committed] Remove a redundant condition check in tic6x-linux-tdep.c
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: yao at codesourcery dot com
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 30 Nov 2012 13:22:28 +0100 (CET)
- Subject: Re: [committed] Remove a redundant condition check in tic6x-linux-tdep.c
- References: <1354260922-13995-1-git-send-email-yao@codesourcery.com>
> From: Yao Qi <yao@codesourcery.com>
> Date: Fri, 30 Nov 2012 15:35:22 +0800
>
> 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.
Hmm, well, perhaps the regnum variable should just be made signed.
That's typically what we use for register numbers, since -1 has the
special meaning of "all registers"/