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

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

 



On Tue, Feb 18 2025 09:49:46 -0800, Junio C Hamano wrote,
> Doesn't it mean that a change that makes these line-number
> variables to size_t is wrong?  Of course the change is not made to
> break the code but may be to please some code paths in other parts
> of the system that wants these line-number variables that are
> currently "int" to compare or assign without range-checking with
> "size_t" quantity or variable,

Sorry but I don't think the change here is wrong. These line-number variables 
are used as unsigned integers (compared with unsigned, used to index arrays, 
...). And what's more important, we even do range-checking on `line` before we 
assign it to those line-number's, which means we want to ensure the 
line-number's always store an unsigned integer. So why not declare these 
line-number's as unsigned if we initialize them as unsigned and at the same 
time use them as unsigned?

Regards.




[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