Re: [PATCH] refs.h: make all flags arguments unsigned

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Han-Wen Nienhuys <hanwen@xxxxxxxxxx> writes:

> On Tue, Feb 1, 2022 at 3:02 AM Junio C Hamano <gitster@xxxxxxxxx> wrote:
>>
>> "Han-Wen Nienhuys via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes:
>>
>> > From: Han-Wen Nienhuys <hanwen@xxxxxxxxxx>
>> >
>> > As discussed in
>> > https://lore.kernel.org/git/xmqqbkzrkevo.fsf@gitster.g/ , we don't
>> > want to treat the sign bit specially, so make all flags in refs.h
>> > unsigned.
>>
>> It may be true that we do not want to, but are we sure there is no
>> code that already uses some cleverness to make the topmost bit
>> special by e.g. doing ugly things like "if (flags < 0)" ;-)?
>
> In refs.h, we don't have any bitmasks that accept 32 different bit
> values, so it's hard to see how we would stumble into a case like
> that.
>
>> I haven't had energy to vet the entire codebase for all flag words
>> and that is why I've never produced a patch like this one myself.
>>
>> Thanks for carefully vetting after creating this (presumably
>> mechanically prepared) patch---producing is the easy part, but
>> making sure it does not break unexpectedly is much harder.
>
> I went over the changes once more, uniformizing the naming. I didn't
> see any shenanigans.

Thanks again.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux