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

Nathan Bossart <nathandbossart@gmail.com>

From: Nathan Bossart <nathandbossart@gmail.com>
To: Wolfgang Walther <walther@technowledgy.de>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2024-11-08T20:00:36Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix sign-compare warnings in pg_iovec.h.

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