lkml.org 
[lkml]   [2002]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] eliminate compile warnings
On Thu, Nov 07, 2002 at 05:33:49PM -0800, Richard Henderson wrote:
> 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.

I will give my patch another thought and I will feed it to you in smaller
pieces and with comments.

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

Generally I'm aware of this - maybe a case of more coffee needed :)

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

Will do.

Thanks for your time.

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] |
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:30    [W:0.217 / U:0.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site