Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: John Baldwin <john@baldwin.cx>
To: Yao Qi <qiyaoltc@gmail.com>, Simon Marchi <simon.marchi@ericsson.com>
Cc: GDB Patches <gdb-patches@sourceware.org>
Subject: Re: Opinion about -Wtautological-compare
Date: Mon, 30 Oct 2017 12:49:00 -0000	[thread overview]
Message-ID: <189cefb7-aa0c-16bd-d78c-cc6f1e5c1344@baldwin.cx> (raw)
In-Reply-To: <CAH=s-PNWH27s24pnMrzb6ixjcLSLszUpPZmUuDAdm6Vi8hjeWw@mail.gmail.com>

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

-- 
John Baldwin


  reply	other threads:[~2017-10-30 12:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-28  3:24 Simon Marchi
2017-10-30  9:35 ` Yao Qi
2017-10-30 12:49   ` John Baldwin [this message]
2017-10-30 14:27     ` Simon Marchi
2017-10-30 14:33     ` [PATCH] Introduce in_inclusive_range, fix -Wtautological-compare warnings Simon Marchi
2017-10-30 15:57       ` John Baldwin
2017-10-30 16:01         ` Simon Marchi
2017-10-30 16:05           ` John Baldwin
2017-10-30 18:29             ` Simon Marchi

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=189cefb7-aa0c-16bd-d78c-cc6f1e5c1344@baldwin.cx \
    --to=john@baldwin.cx \
    --cc=gdb-patches@sourceware.org \
    --cc=qiyaoltc@gmail.com \
    --cc=simon.marchi@ericsson.com \
    /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