From: Thorsten Kranzkowski <dl8bcu@dl8bcu.de>
To: axp-list@redhat.com
Cc: michal@ellpspace.math.ualberta.ca
Subject: Re: [PATCH] eliminate compile warnings
Date: Sat, 9 Nov 2002 01:32:58 +0000 [thread overview]
Message-ID: <20021109013258.K18411@Marvin.DL8BCU.ampr.org> (raw)
In-Reply-To: <20021108174229.B5518@ellpspace.math.ualberta.ca>; from michal@ellpspace.math.ualberta.ca on Fri, Nov 08, 2002 at 05:42:29PM -0700
On Fri, Nov 08, 2002 at 05:42:29PM -0700, Michal Jaegermann wrote:
> On Fri, Nov 08, 2002 at 09:50:56PM +0000, Thorsten Kranzkowski wrote: > > if you will try to _reduce_ number of casts by making sure that types of
> > > objects agree, if only possible, instead of sprinkling code with extra
> >
> > I've actually done that.
>
> You mean in a version you are working on now? There was quite
yes, indeed. estimated 60-70% were redefined variables, not casts.
> a few extra casts in what I have seen. Some of them appeared
> "obviously correct" but this was not the case for others.
>
> > > But if you want a unsigned constant with all bits on then ~0UL is surely
> > > preferable over casting (-1) to unsigned long; even if just for clarity.
> >
> > ok, what do you suggest when there's a
> > return ( x ? 0 : -ENOMEM )
> > in a function declared as unsigned long ?
>
> I noticed this in a patch for setup.c:
>
> - if (bootmap_start == -1) {
> + if (bootmap_start == (unsigned long)-1L) {
>
> What I meant that it seems that you really wanted here
>
> if (bootmap_start == ~0UL) {
yes, you're right. I've done it that way now.
> I did not check if there are other spots of that sort.
>
> If you refer to what displeased Richard then if a return value from
I made the stupid error to think (signed) only changes signedness.
I actually knew that this is not the case, but....
Now I'll stand ashamed in the corner for five minutes :)
> Michal
Thorsten
--
| Thorsten Kranzkowski Internet: dl8bcu@dl8bcu.de |
| Mobile: ++49 170 1876134 Snail: Niemannsweg 30, 49201 Dissen, Germany |
| Ampr: dl8bcu@db0lj.#rpl.deu.eu, dl8bcu@marvin.dl8bcu.ampr.org [44.130.8.19] |
next prev parent reply other threads:[~2002-11-09 1:33 UTC|newest]
Thread overview: 16+ 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 17:17 ` Ted Goodridge
2002-11-07 19:59 ` George France
2002-11-07 20:28 ` Thorsten Kranzkowski
2002-11-07 20:55 ` George France
2002-11-08 1:33 ` Richard Henderson
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-08 17:28 ` Michal Jaegermann
2002-11-08 21:50 ` Thorsten Kranzkowski
2002-11-09 0:42 ` Michal Jaegermann
2002-11-09 1:32 ` Thorsten Kranzkowski [this message]
[not found] ` <3DCA9A88.4060109@pobox.com>
2002-11-07 21:43 ` Thorsten Kranzkowski
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox