public inbox for [email protected]  
help / color / mirror / Atom feed
From: Nathan Bossart <[email protected]>
To: Wolfgang Walther <[email protected]>
Cc: [email protected]
Subject: Re: Fix port/pg_iovec.h building extensions on x86_64-darwin
Date: Fri, 8 Nov 2024 14:00:36 -0600
Message-ID: <Zy5t5FAmNKsJGf44@nathan> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

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






view thread (4+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Fix port/pg_iovec.h building extensions on x86_64-darwin
  In-Reply-To: <Zy5t5FAmNKsJGf44@nathan>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox