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 1uz22c-00Fmd2-Gn for pgpool-hackers@arkaria.postgresql.org; Wed, 17 Sep 2025 23:58:26 +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 1uz22b-00C5kS-9H for pgpool-hackers@arkaria.postgresql.org; Wed, 17 Sep 2025 23:58:25 +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 1uz22b-00C5jg-3S for pgpool-hackers@lists.postgresql.org; Wed, 17 Sep 2025 23:58:25 +0000 Received: from meldrar.postgresql.org ([2a02:c0:301:0:ffff::31]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uz22X-001PIm-0a for pgpool-hackers@lists.postgresql.org; Wed, 17 Sep 2025 23:58:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Content-Transfer-Encoding:Content-Type: Mime-Version:References:In-Reply-To:From:Subject:Cc:To:Message-Id:Date:Sender :Reply-To:Content-ID:Content-Description; bh=pPe+R8URJeMfX315Hwa9+NIpRFdYjwnL2nwwtzVKQ14=; b=TxJCuQ3eR+ewuPy1NgT80RhYrp H1l29RG+G6JnLn3TuO4w23xhYCp9VpNOIG23PL3MeCZZ3hrEz/YcZIf3znxUvT2OVOCjs6hBDHIfm yts7k8GLavXcez2XOpkgPeO9n+X1wWD0PSsWl27k6NCaUsCG2OQrq0rx6DHnylZGwGiZlP5qYnExK qF5+Uo7oWLJwKwImjm+NyhL7qOQZcuUg9a8PxgMHohO00KC+MhL78gnY4fApjIEiO/TTS3JcGd8Ae mchPtSpDpEkW+0PmSttnmqpu6cN1QKpaaU7T/x/+XmBawGdq39oySOhRZVYNlE/zsf9F8+zY0x0kN 2ozu6nmQ==; Received: from [2409:11:4120:300:22b8:1347:56f3:9fe1] (helo=localhost) by meldrar.postgresql.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uz22W-002nrE-0P; Wed, 17 Sep 2025 23:58:22 +0000 Date: Thu, 18 Sep 2025 08:58:16 +0900 (JST) Message-Id: <20250918.085816.1591426349627091974.ishii@postgresql.org> To: skandigraun@gmail.com Cc: pgpool-hackers@lists.postgresql.org Subject: Re: Compiling issues for 32-bit targets From: Tatsuo Ishii In-Reply-To: <20250917.194736.353755422175293639.ishii@postgresql.org> References: <20250917.194736.353755422175293639.ishii@postgresql.org> X-Mailer: Mew version 6.8 on Emacs 29.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2409:11:4120:300:22b8:1347:56f3:9fe1 (failed) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > Gyorgy Sarvari pointed out that snprintf.c has > issues when compiled on 32-bit targets: > https://github.com/pgpool/pgpool2/pull/128 > >> the compiler was complaining about undefined isnan and ininf functions in >> snprintf.c file > > (Moreover he pointed out another issue. will discuss later on) > >> When building for 32-bit arm arch, compilation fails with the following error: >> | snprintf.c: In function 'fmtfloat': >> | snprintf.c:1232:13: error: implicit declaration of function 'isnan' [-Wimplicit-function-declaration] >> | 1232 | if (isnan(value)) >> | | ^~~~~ >> | snprintf.c:50:1: note: include '' or provide a declaration of 'isnan' >> | 49 | #include "postgresql/server/port.h" >> | +++ |+#include >> | 50 | >> | snprintf.c:1254:21: error: implicit declaration of function 'isinf' [-Wimplicit-function-declaration] >> | 1254 | if (isinf(value)) >> | | ^~~~~ >> | snprintf.c:1254:21: note: include '' or provide a declaration of 'isinf' >> >> To avoid the error, add math.h to snprintf.c. > > I think his idea is good. snprintf.c was imported from PostgreSQL long > time ago. If we look into the original file (src/port/snprintf.c) it > actually has "#include " already. > > If there's no objection, I will push attached patch to all supported > branches. It not only adds math.h, but remove ancient ruin "#if 0" and > sort out the order of including files. Patch pushd to all supported branches. Thanks. -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp