Re: [PATCH] mm: vmscan: Avoid signedness error for GCC 5.4

Matthew Wilcox
2025-05-07T20:50:34Z

On Wed, May 07, 2025 at 11:07:01AM -0700, Andrew Morton wrote:
> `int' is a curse. Yes, we do this very frequently - we unthinkingly
> use a signed type for a naturally unsigned concept. Ths signed type
> spreads and spreads and the incorrect signage causes (small) problems
> in various places. By then it's a big mess trying to switch to an
> unsigned type.
>
> Oh well, we just battle on. We should at least be more vigilant about
> this when adding new things.
>
>
> hp2:/usr/src/25> grep "int nid" mm/*.c | wc -l
> 316

$ git grep def.*NUMA_NO_NODE include
include/linux/nodemask_types.h:#define NUMA_NO_NODE (-1)

I bet if you change all of those to unsigned, you'll get a
non-functional kernel. C is awful, we need to dump it.