Subject: Re: [GSOC][PATCH] apply: address -Wsign-comparison warnings

From: Junio C Hamano <[email-masked]>
Date: Tue, 25 Feb 2025 04:53:28 -0800

Zejun Zhao <[email-masked]> writes:

> Thank you for explaining. I'll separate the desired changes from this patch to 
> another since the topic will be different.
>
> By the way, should we remove the idea from the microproject list now that we 
> may not want it?

It is not like we do not want it, I think.

If you read https://git.github.io/SoC-2025-Microprojects/ (the first
entry) carefully, it does not say "find anything that -Wsign-compare
warns about and squelch the warning by using widest type common
among the quantities involved in the expression the compiler warns
about" at all.  Most specifically, it does *not* tell you to achieve
it "by using widest type".  You would squelch the warning using the
most appropriate type, which may not be the widest one.  In the case
we discussed in this thread, it was line number whose type was the
platform natural integer, but mixed up with other size_t things that
caused the compiler warning.  Blindly using size_t to squelch it may
not be what we want, but that does not mean we do not want to
squelch it by doing something else (like, by not bringing "size_t"
quantity into the picture).