Re: [PATCH] sign-compare: 32-bit support

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

 



On Wed, Dec 04, 2024 at 02:47:22PM +0900, Junio C Hamano wrote:
> On 32-bit platforms, ssize_t may be "int" while size_t may be
> "unsigned int".  At times we compare the number of bytes we read
> stored in a ssize_t variable with "unsigned int", but that is done
> after we check that we did not get an error return (which is
> negative---and that is the whole reason why we used ssize_t and not
> size_t), so these comparisons are safe.
> 
> But compilers may not realize that.  Cast these to size_t to work
> around the false positives.  On platforms with size_t/ssize_t wider
> than a normal int, this won't be an issue.

Thanks for the patch! Will include in v3.

Patrick




[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