git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [GSoC PATCH v2] decorate: fix sign comparison warnings

From
Arnav Bhate <bhatearnav@gmail.com>
Date
Mar 11, 2025, 18:26 UTC
Message-ID
<c7045e4a-51af-4fff-b6e3-36afff005c77@gmail.com>
In-Reply-To
<CAOLa=ZS=+UGf5yQO3nVhLFJ7BgsSSxigKA3CTqEVez2zkQKyoA@mail.gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
Show 16 quoted lines
> Arnav Bhate <bhatearnav@gmail.com> writes:
> 
>> There are multiple instances where ints have been initialized with
>> values of unsigned ints, and where negative values don't mean anything.
>> When such ints are compared with unsigned ints, it causes sign comparison
>> warnings.
>>
>> Also, some of these are used just as stand-ins for their initial
>> values, never being modified, thus obscuring the specific conditions
>> under which certain operations happen.
>>
>> Replace int with unsigned int for 2 variables, and replace the
>> intermediate variables with their initial values for 2 other variables.
> 
> Nit: worthwhile to mention that we also remove the
> `DISABLE_SIGN_COMPARE_WARNINGS` macro as a result of this change.
I'll keep this in mind for my next contribution.
-- 
Regards,
Arnav Bhate
(He/Him)
Previous: Karthik Nayak
Message 6 of 6 in “decorate: fix sign comparison warnings”
  1. decorate: fix sign comparison warningsArnav Bhate, Mar 10, 2025
  2. Junio C HamanoMar 10, 2025
  3. Arnav BhateMar 10, 2025
  4. decorate: fix sign comparison warningsArnav Bhate, Mar 10, 2025
  5. Karthik NayakMar 10, 2025
  6. Arnav BhateMar 11, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.