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 1sT0WD-00CBio-Hy for pgsql-hackers@arkaria.postgresql.org; Sun, 14 Jul 2024 14:48:06 +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 1sT0WA-005pFO-AU for pgsql-hackers@arkaria.postgresql.org; Sun, 14 Jul 2024 14:48:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sT0W8-005pFG-Gv for pgsql-hackers@lists.postgresql.org; Sun, 14 Jul 2024 14:48:02 +0000 Received: from fhigh8-smtp.messagingengine.com ([103.168.172.159]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sT0W4-0025b7-Hf for pgsql-hackers@lists.postgresql.org; Sun, 14 Jul 2024 14:47:59 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfhigh.nyi.internal (Postfix) with ESMTP id EBEDA1140386; Sun, 14 Jul 2024 10:47:53 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sun, 14 Jul 2024 10:47:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm1; t=1720968473; x=1721054873; bh=yAHNLF+vOr76+O7f5ywZkac0ogNuu0Yc pg1FZXLn7Ak=; b=K5r3ZhzBlHI1YPn4i4ICI7/21cIoDLoVLWgCa2WtAZwXbi6w Yy4appJHQw3SKQdmFFLMJzQ1mE4/WOfIUZfxWb+qyzKOv8Xp7/meq6/CUUVhN+sY OvuVpvV+Qs7KRoB7YKBfbo9VVWWDfld8dgUDzgCYjbKBorEvvBFN4DplUFr79BQa g/fq0/hnFkTBOd5En6MjJEPo5fMHpZw5lRr+o2rdOZMhZOa2JxwJm5lxXSIFjz2h 8IlPTHx/p9Ry+SKDjNJEebAb4APSJ93ecXjPbVtgNGhOGeqbcRxdKauRbqo2LJpV wOMfsD7H9ZUVOQ+/VdjU1mnezDsvkEBOxGyg9A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1720968473; x= 1721054873; bh=yAHNLF+vOr76+O7f5ywZkac0ogNuu0Ycpg1FZXLn7Ak=; b=n sKslx/Vny6b23OQ+TPYUYoNkLLjtFhUSq6i45j5CMI0wl4Fomgo1aNi7nfqBBnny xEAh6OyCHVTMYX8CYrgpAngmLUi4S+N5CLvAZslR6fWCqqBDnKiHQrNDU1gj6VvC dmyEyvoxtX8DJgv2MWb4fEySWbATLDiPqq6tGWvYBcCKdJPU8ge3pcbf1Fznr5mr t9Rz5QzCy4RE8fgmKoLDlCRN3sO/J1a8sBgygBGvwtdoREHFKbzrL+e9r5P8HbyC 6gg2UjC7di5Lq6uOhublc0tfpMXyUKCYjyAL+nA59i6o0qqO2+6ZmSfYcTNJ6asZ e5CXwn4+OcvV0Lb/B3pQQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrgedtgdekudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomheprfgvthgv rhcugfhishgvnhhtrhgruhhtuceophgvthgvrhesvghishgvnhhtrhgruhhtrdhorhhgqe enucggtffrrghtthgvrhhnpefgjedthfekfedtuefgieelheetleejgefhueeltdfhueet vdffudekfeejhfegheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehpvghtvghrsegvihhsvghnthhrrghuthdrohhrgh X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 14 Jul 2024 10:47:51 -0400 (EDT) Message-ID: Date: Sun, 14 Jul 2024 15:47:50 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Cannot find a working 64-bit integer type on Illumos To: Thomas Munro , Heikki Linnakangas Cc: Tom Lane , Japin Li , Andres Freund , PostgreSQL Hackers References: <20240322165305.6zrtxcmzdrywvmsu@awork3.anarazel.de> <944094.1711128356@sss.pgh.pa.us> <1229869.1711160593@sss.pgh.pa.us> <7cf1dcb7-306f-4418-bf25-bdc75130db10@eisentraut.org> From: Peter Eisentraut Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 04.07.24 03:55, Thomas Munro wrote: > Unfortunately, that theory turned out to be wrong. The usual suspect, > Windows, uses something else: "I64" or something like that. We could > teach our snprintf to grok that, but I don't like the idea anymore. > So let's go back to INT64_MODIFIER, with just a small amount of > configure time work to pick the right value. I couldn't figure out > any header-only way to do that. src/port/snprintf.c used to support I64 in the past, but it was later removed. We could probably put it back. >> Personally, I find "PRId64" pretty unreadable. "INT64_MODIFIER" wasn't >> nice either, though, and following standards is good, so I'm sure I'll >> get used to it. Using PRId64 would be very beneficial because gettext understands it, and so we would no longer need the various workarounds for not putting INT64_FORMAT into the middle of a translated string. But this could be a separate patch. What you have works for now. Here are some other comments on this patch set: * v3-0001-Use-int64_t-support-from-stdint.h.patch - src/include/c.h: Maybe add a comment that above all the int8_t -> int8 etc. typedefs that these are for backward compatibility or something like that. Actually, just move the comment +/* Historical names for limits in stdint.h. */ up a bit to it covers the types as well. Also, these /* == 8 bits */ comments could be removed, I think. - src/include/port/pg_bitutils.h: - src/port/pg_bitutils.c: - src/port/snprintf.c: These changes look functionally correct, but I think I like the old code layout better, like #if (using long) ... #elif (using long long) ... #else #error #endif rather than #if (using long) ... #else static assertion ... // long long #endif which seems a bit more complicated. I think you could leave the code mostly alone and just change defined(HAVE_LONG_INT_64) to SIZEOF_LONG == 8 defined(HAVE_LONG_LONG_INT_64) to SIZEOF_LONG_LONG == 8 in each case. - src/include/postgres_ext.h: -#define OID_MAX UINT_MAX -/* you will need to include to use the above #define */ +#define OID_MAX UINT32_MAX If the type Oid is unsigned int, then the OID_MAX should be UINT_MAX. So this should not be changed. Also, is the comment about no longer applicable? - src/interfaces/ecpg/ecpglib/typename.c: - src/interfaces/ecpg/include/sqltypes.h: - .../test/expected/compat_informix-sqlda.c: -#ifdef HAVE_LONG_LONG_INT_64 +#if SIZEOF_LONG < 8 These changes alter the library behavior unnecessarily. The old code would always prefer to report back long long (ECPGt_long_long etc.), but the new code will report back long (ECPGt_long etc.) if it is 64-bit. I don't know the impact of these changes, but it seems preferable to keep the existing behavior. - src/interfaces/ecpg/include/ecpg_config.h.in: - src/interfaces/ecpg/include/meson.build: In the past, we have kept obsolete symbols as always defined in ecpg_config.h. We ought to do the same here. * v3-0002-Remove-traces-of-BeOS.patch This looks ok. This could also be committed before 0001. * v3-0003-Allow-tzcode-to-use-stdint.h-and-inttypes.h.patch - src/timezone/localtime.c: Addition of #include is unnecessary, since it's already included in c.h, and it's also not in the upstream code. This looks like a typo: - * UTC months are at least 28 days long (minus 1 second for a + * UTC months are at least 2 days long (minus 1 second for a -getsecs(const char *strp, int32 *const secsp) +getsecs(const char *strp, int_fast32_t * const secsp) Need to add int_fast32_t (and maybe the other types) to typedefs.list? - src/timezone/zic.c: +#include +#include We don't need both of these. Also, this is not in the upstream code AFAICT.