public inbox for [email protected]  
help / color / mirror / Atom feed
From: Wolfgang Walther <[email protected]>
To: [email protected]
Subject: Fix port/pg_iovec.h building extensions on x86_64-darwin
Date: Fri, 8 Nov 2024 20:08:06 +0100
Message-ID: <[email protected]> (raw)

When building pg_cron [1] or pg_hll [2] for PG 17 on x86_64-darwin, we 
encounter the following build failure in nixpkgs:


/nix/store/2clw9wg933c40f871d8iqbl909lg2yis-postgresql-17.0-dev/include/server/port/pg_iovec.h:71:12: 
error: comparison of integers of different signs: 'ssize_t' (aka 'long') 
and 'const size_t' (aka 'const unsigned long') [-Werror,-Wsign-compare]
                 if (part < iov[i].iov_len)
                     ~~~~ ^ ~~~~~~~~~~~~~~
/nix/store/2clw9wg933c40f871d8iqbl909lg2yis-postgresql-17.0-dev/include/server/port/pg_iovec.h:110:12: 
error: comparison of integers of different signs: 'ssize_t' (aka 'long') 
and 'const size_t' (aka 'const unsigned long') [-Werror,-Wsign-compare]
                 if (part < iov[i].iov_len)
                     ~~~~ ^ ~~~~~~~~~~~~~~
2 errors generated.


The attached patch fixes those.

Hopefully this can make it into the minor release next week.

Best,

Wolfgang

[1]: https://hydra.nixos.org/build/276421287/nixlog/1
[2]: https://hydra.nixos.org/build/276419879/nixlog/1

Attachments:

  [text/x-patch] 0001-Fix-build-on-x86_64-darwin.patch (2.4K, ../[email protected]/2-0001-Fix-build-on-x86_64-darwin.patch)
  download | inline diff:
From c906b182b5503c9ceebf58e25e3496157c29dedb Mon Sep 17 00:00:00 2001
From: Wolfgang Walther <[email protected]>
Date: Fri, 8 Nov 2024 19:41:00 +0100
Subject: [PATCH] Fix pg_cron/pg_hll build on x86_64-darwin

In file included from src/hll.c:28:
In file included from
/nix/store/24rwyvsc90nhww5dfdp37cwq4c1vycgi-postgresql-jit-17.0-dev/include/server/funcapi.h:21:
In file included from
/nix/store/24rwyvsc90nhww5dfdp37cwq4c1vycgi-postgresql-jit-17.0-dev/include/server/executor/executor.h:17:
In file included from
/nix/store/24rwyvsc90nhww5dfdp37cwq4c1vycgi-postgresql-jit-17.0-dev/include/server/executor/execdesc.h:18:
In file included from
/nix/store/24rwyvsc90nhww5dfdp37cwq4c1vycgi-postgresql-jit-17.0-dev/include/server/nodes/execnodes.h:46:
In file included from
/nix/store/24rwyvsc90nhww5dfdp37cwq4c1vycgi-postgresql-jit-17.0-dev/include/server/utils/sharedtuplestore.h:17:
In file included from
/nix/store/24rwyvsc90nhww5dfdp37cwq4c1vycgi-postgresql-jit-17.0-dev/include/server/storage/fd.h:46:
/nix/store/24rwyvsc90nhww5dfdp37cwq4c1vycgi-postgresql-jit-17.0-dev/include/server/port/pg_iovec.h:71:12:
error: comparison of integers of different signs: 'ssize_t' (aka 'long')
and 'const size_t' (aka 'const unsigned long') [-Werror,-Wsign-compare]
                if (part < iov[i].iov_len)
                    ~~~~ ^ ~~~~~~~~~~~~~~
/nix/store/24rwyvsc90nhww5dfdp37cwq4c1vycgi-postgresql-jit-17.0-dev/include/server/port/pg_iovec.h:110:12:
error: comparison of integers of different signs: 'ssize_t' (aka 'long')
and 'const size_t' (aka 'const unsigned long') [-Werror,-Wsign-compare]
                if (part < iov[i].iov_len)
                    ~~~~ ^ ~~~~~~~~~~~~~~
2 errors generated.
---
 src/include/port/pg_iovec.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/include/port/pg_iovec.h b/src/include/port/pg_iovec.h
index 7255c1bd911..e5fe677b371 100644
--- a/src/include/port/pg_iovec.h
+++ b/src/include/port/pg_iovec.h
@@ -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;
-- 
2.47.0



view thread (2+ messages)

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]
  Subject: Re: Fix port/pg_iovec.h building extensions on x86_64-darwin
  In-Reply-To: <[email protected]>

* 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