From: Arnav Bhate <bhatearnav@gmail.com>
To: Karthik Nayak <karthik.188@gmail.com>, git@vger.kernel.org
Subject: Re: [GSoC PATCH v2] decorate: fix sign comparison warnings
Date: Tue, 11 Mar 2025 23:56:42 +0530 [thread overview]
Message-ID: <c7045e4a-51af-4fff-b6e3-36afff005c77@gmail.com> (raw)
In-Reply-To: <CAOLa=ZS=+UGf5yQO3nVhLFJ7BgsSSxigKA3CTqEVez2zkQKyoA@mail.gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
> 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)
prev parent reply other threads:[~2025-03-11 18:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-10 9:51 [GSoC PATCH] decorate: fix sign comparison warnings Arnav Bhate
2025-03-10 16:40 ` Junio C Hamano
2025-03-10 18:07 ` Arnav Bhate
2025-03-10 18:08 ` [GSoC PATCH v2] " Arnav Bhate
2025-03-10 21:02 ` Karthik Nayak
2025-03-11 18:26 ` Arnav Bhate [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c7045e4a-51af-4fff-b6e3-36afff005c77@gmail.com \
--to=bhatearnav@gmail.com \
--cc=git@vger.kernel.org \
--cc=karthik.188@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).