Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t9VA1-00AZ6w-Vt for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Nov 2024 20:00:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t9V9x-00Cxwu-TN for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Nov 2024 20:00:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t9V9x-00Cxwl-Gh for pgsql-hackers@lists.postgresql.org; Fri, 08 Nov 2024 20:00:46 +0000 Received: from mail-io1-xd29.google.com ([2607:f8b0:4864:20::d29]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1t9V9r-000rCH-KY for pgsql-hackers@lists.postgresql.org; Fri, 08 Nov 2024 20:00:44 +0000 Received: by mail-io1-xd29.google.com with SMTP id ca18e2360f4ac-83aad8586d3so97736539f.1 for ; Fri, 08 Nov 2024 12:00:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731096039; x=1731700839; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=oE2ZjRz1ez5GGzi2U7sAFwB1uA+6KySH4Zujg+IgKqc=; b=Y//xY/wlqSH4vYDKHXvB9Ksc2D1KQeZQjEgXojicLLPMUqJo3AWrJsDBnkt7b6DTGq HUng45hJ2fRy43BXGOnkjRTxZ592sNF7LQsJiBuujwXLOrb7yKq5dfvGHH0q8jAckhX+ c5zu0yZXDMFncOFaAHoQISwsYke+XhXaiYurUSIN2hmUBroxtvjVU5qhc8FO3NCUe9jv DkbbsXIGf1p0XwH2L528Rb2rx68o3AhoXNutbO0r6PRsOLjqfEAmjqAA+vRvAzC5aAjd /Xlw0lQcOc07Hlce0bBKDG5iZKcK/JoXhyjpOrrqGoe5g4DBQJYhbM+4lOh1wKzPM2sN a/1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731096039; x=1731700839; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=oE2ZjRz1ez5GGzi2U7sAFwB1uA+6KySH4Zujg+IgKqc=; b=KfBtiu2Q38OsOvyzkZCsTWdNmB3L6aCSb5DLGons2N0oCZwDJrzNd736vnBSLozz7w Pc6t7c9c55f+6SWY/n0f5+SFTJBWHmRU6mWMo4rYd5KyXjzmSqDZigjlXWnxgbGUpzSD eZhrHQQpQkBMC4WQNVjqtq0ABEpvXb6x+rCP0t3GPVN20TJERgSUUCp7mfk59CLYyBFN R1jbuHlnIskEXBbw0kGkW9D6npD5Unn886wLxqkmsgz63/JhU0UWqo+n9F/Zb8AZzweo nX9KM7BIGAatz7dtZ1yD/6U8dxMXkEuSYCIdj6Lp7/0YQET8s05ozD/Xq6J1a3lYZfAO AFAQ== X-Gm-Message-State: AOJu0YwH85ERPgEGh/62K0jxprVdKYh0fzW1ZfAXGTOm1o0ftww6RSZk TYecj6IAbOfbpgpPyV+bRZNcbQby9A00Sd9jgMzk52mlJgcAIPzT X-Google-Smtp-Source: AGHT+IFheHIzW2B4tCtxPWVbOIlhWQwzS81HRNboug3ObZ8GAYXHuoVYnBN615LZxRHeIYhCURlu4w== X-Received: by 2002:a05:6602:6402:b0:83a:a746:68a6 with SMTP id ca18e2360f4ac-83e032b3656mr485401339f.5.1731096038654; Fri, 08 Nov 2024 12:00:38 -0800 (PST) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4de5f8f7ef4sm965541173.157.2024.11.08.12.00.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2024 12:00:38 -0800 (PST) Date: Fri, 8 Nov 2024 14:00:36 -0600 From: Nathan Bossart To: Wolfgang Walther Cc: pgsql-hackers@lists.postgresql.org Subject: Re: Fix port/pg_iovec.h building extensions on x86_64-darwin Message-ID: References: <16989737-1aa8-48fd-8dfe-b7ada06509ab@technowledgy.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16989737-1aa8-48fd-8dfe-b7ada06509ab@technowledgy.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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