All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: George France <france@handhelds.org>,
	axp-list mailing list <axp-list@redhat.com>,
	linux-kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] eliminate compile warnings
Date: Thu, 7 Nov 2002 17:33:49 -0800	[thread overview]
Message-ID: <20021107173349.A4017@twiddle.net> (raw)
In-Reply-To: <20021107202855.B17028@Marvin.DL8BCU.ampr.org>; from dl8bcu@dl8bcu.de on Thu, Nov 07, 2002 at 08:28:55PM +0000

As for the patch itself, it's not correct.  At a glance,

> 	addr = arch_get_unmapped_area_1 (PAGE_ALIGN(addr), len, limit);
> -	if (addr != -ENOMEM)
> +	if (addr != (unsigned) -ENOMEM)

addr is unsigned long.  If you truncate -ENOMEM to 32-bits, it will
never match.  There appears to be much more int/long confusion later.

You have to be /exceedingly/ careful to fix these warnings without
introducing new bugs.  If you change the type of a variable, you 
have to examine each and every use of the variable to determine if
the semantics are unchanged.  If you add a cast, you have to be sure
that you cast to a type of the correct width.  If you're adding lots
of casts, you should think about changing the type of one or more
variables.

It's enough to make me wish we had -Wno-sign-compare in CFLAGS by
default for the nonce.  Which, incidentally, is what I've been doing
for my own builds.

There's absolutely no way I'm going to apply a jumbo patch that
changes hundreds of these at once.  If you still want to fix these,
then you'll need to send them one at a time and include analysis of
why each change is correct.


r~

  parent reply	other threads:[~2002-11-08  1:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-06 21:47 [PATCH] eliminate compile warnings Thorsten Kranzkowski
2002-11-07 14:22 ` George France
2002-11-07 16:53   ` Jeff Garzik
2002-11-07 21:43     ` Thorsten Kranzkowski
2002-11-07 20:28   ` Thorsten Kranzkowski
2002-11-07 20:55     ` George France
2002-11-08  1:33     ` Richard Henderson [this message]
2002-11-08  2:54       ` George France
2002-11-08  3:25         ` Richard Henderson
2002-11-08  4:04           ` George France
2002-11-08  7:38       ` Thorsten Kranzkowski
2002-11-09 20:55   ` Geert Uytterhoeven
2002-11-09 21:03     ` Cort Dougan

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=20021107173349.A4017@twiddle.net \
    --to=rth@twiddle.net \
    --cc=axp-list@redhat.com \
    --cc=france@handhelds.org \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.