This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Opinion about -Wtautological-compare
- From: Simon Marchi <simon dot marchi at polymtl dot ca>
- To: John Baldwin <john at baldwin dot cx>
- Cc: Yao Qi <qiyaoltc at gmail dot com>, Simon Marchi <simon dot marchi at ericsson dot com>, GDB Patches <gdb-patches at sourceware dot org>
- Date: Mon, 30 Oct 2017 10:26:43 -0400
- Subject: Re: Opinion about -Wtautological-compare
- Authentication-results: sourceware.org; auth=none
- References: <f64bd46a-acb0-2031-d408-a331245e1fd5@ericsson.com> <CAH=s-PNWH27s24pnMrzb6ixjcLSLszUpPZmUuDAdm6Vi8hjeWw@mail.gmail.com> <189cefb7-aa0c-16bd-d78c-cc6f1e5c1344@baldwin.cx>
On 2017-10-30 08:49, John Baldwin wrote:
On 10/30/17 9:35 AM, Yao Qi wrote:
On Sat, Oct 28, 2017 at 4:24 AM, Simon Marchi
<simon.marchi@ericsson.com> wrote:
Personally, I think the warning is useful and can reveal bugs, so I'd
like to keep
it. I lean towards 2 or 3, because they help convey the idea that we
check if the
value is within a range. If you are following with the architecture
manual on the
side, it will probably show the same range (0-3) for those bits, so
it helps if the
code does the same.
My vote is 3. PR 22188.
I vote for 3 as well. I think it is useful to describe both bounds of
a value
explicitly even if one bound is at the "edge".
Thanks to you both, I'll post a patch shortly.
Simon