Thread: Re: Fix port/pg_iovec.h building extensions on x86_64-darwin

Re: Fix port/pg_iovec.h building extensions on x86_64-darwin

From
Nathan Bossart
Date:
On Fri, Nov 08, 2024 at 08:08:06PM +0100, Wolfgang Walther wrote:
> @@ -68,7 +68,7 @@ pg_preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset)
>          }
>          sum += part;
>          offset += part;
> -        if (part < iov[i].iov_len)
> +        if ((size_t) part < iov[i].iov_len)
>              return sum;
>      }
>      return sum;
> @@ -107,7 +107,7 @@ pg_pwritev(int fd, const struct iovec *iov, int iovcnt, off_t offset)
>          }
>          sum += part;
>          offset += part;
> -        if (part < iov[i].iov_len)
> +        if ((size_t) part < iov[i].iov_len)
>              return sum;
>      }
>      return sum;

This looks correct to me.  At this point in the code, we know that part >=
0, so casting it to an unsigned long ought to be okay.

-- 
nathan



Re: Fix port/pg_iovec.h building extensions on x86_64-darwin

From
Nathan Bossart
Date:
On Fri, Nov 08, 2024 at 03:20:00PM -0600, Nathan Bossart wrote:
> Here is a new version of the patch with an updated commit message.  The
> cfbot results [0] look good, so I plan to commit this one shortly unless
> someone objects.

Committed.

-- 
nathan