public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@redhat.com>
To: Morten Welinder <terra@diku.dk>
Cc: gcc@gcc.gnu.org
Subject: Re: Relaxing -Wsign-compare
Date: Thu, 20 Sep 2001 16:34:00 -0000	[thread overview]
Message-ID: <20010920163416.B1034@redhat.com> (raw)
In-Reply-To: <20010920154527.26304.qmail@ntyr.diku.dk>

On Thu, Sep 20, 2001 at 03:45:27PM -0000, Morten Welinder wrote:
> Would it be reasonable to silence this warning when one of the sides is
> a constant (in the C meaning) that fits well within the range of the
> other side's type?

No.

C type rules still mandate the promotion of the signed argument to
unsigned.  Which means that if you do not know for a fact that the
signed argument is non-negative, you still have a problem.  Which
you can't know without data-flow analysis, and the warning is based
simply on the existance of the promotion.

Make 'i' a size_t like it ought to have been in the first place.


r~

  parent reply	other threads:[~2001-09-20 16:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-20  8:45 Morten Welinder
2001-09-20 11:43 ` Neil Booth
2001-09-20 12:03   ` Morten Welinder
2001-09-20 16:37   ` Richard Henderson
2001-09-20 12:11 ` Frank Klemm
2001-09-21  2:46   ` Gabriel Paubert
2001-09-20 16:34 ` Richard Henderson [this message]
2001-09-21 10:48   ` Morten Welinder
2001-09-21 11:07     ` Richard Henderson
2001-09-21 14:47       ` Fergus Henderson
2001-09-23 15:30     ` Frank Klemm
2001-09-21 14:54   ` Fergus Henderson

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=20010920163416.B1034@redhat.com \
    --to=rth@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=terra@diku.dk \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).