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 1uyphX-00DQFB-Ge for pgpool-hackers@arkaria.postgresql.org; Wed, 17 Sep 2025 10:47:51 +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 1uyphV-006CNu-8y for pgpool-hackers@arkaria.postgresql.org; Wed, 17 Sep 2025 10:47:50 +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 1uyphU-006CNm-Tt for pgpool-hackers@lists.postgresql.org; Wed, 17 Sep 2025 10:47:49 +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 1uyphR-001IYL-0q for pgpool-hackers@lists.postgresql.org; Wed, 17 Sep 2025 10:47:49 +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:From:Subject:Cc:To:Message-Id:Date:Sender:Reply-To:Content-ID: Content-Description:In-Reply-To:References; bh=jmLHIl2K4GPzrLmq3VfHFFCUGZQz4TXSQUTYEcIe9Ug=; b=UCjDuBcz6527e92xgConVSBy5P JaoeFJmmnK2TaBaSNItDiYMFO4NDgEH+D/reMeronZaz6tmyf+za0A4umUwNpA3MKSCp2OTepLsJP clHWdl5Rsl/icg3b/p1qvP/6I4z/UEN38s3IEcQY5Q4BHQ5U4a9mNRUc4tU69tSd5vwlAvNxllgvJ cvX9iZm6fc9DNThu/Ommqhqj3ckj0r1J3zomJW1O79OBmJJyWaqbltH30j0phTvNNa1UB5TmnByZk MYhPH0lDrhq7OPLMICcpbwktSMIQEHolTnYSgcOezqWWtx3onuRB0JPDQ8inr1qd3DIJSo5mHYEM4 Wc3SvlYA==; Received: from [2409:11:4120:300:9c46:85e3:548c:edd1] (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 1uyphQ-002bXK-1G; Wed, 17 Sep 2025 10:47:46 +0000 Date: Wed, 17 Sep 2025 19:47:36 +0900 (JST) Message-Id: <20250917.194736.353755422175293639.ishii@postgresql.org> To: pgpool-hackers@lists.postgresql.org Cc: skandigraun@gmail.com Subject: Compiling issues for 32-bit targets From: Tatsuo Ishii X-Mailer: Mew version 6.8 on Emacs 29.3 Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Wed_Sep_17_19_47_36_2025_008)--" Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2409:11:4120:300:9c46:85e3:548c:edd1 (failed) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ----Next_Part(Wed_Sep_17_19_47_36_2025_008)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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. Best regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ----Next_Part(Wed_Sep_17_19_47_36_2025_008)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="snprintf.patch" diff --git a/src/parser/snprintf.c b/src/parser/snprintf.c index c3564935e..ec0355205 100644 --- a/src/parser/snprintf.c +++ b/src/parser/snprintf.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2024, PgPool Global Development Group + * Copyright (c) 2003-2025, PgPool Global Development Group * Copyright (c) 1983, 1995, 1996 Eric P. Allman * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -32,17 +32,14 @@ * src/port/snprintf.c */ -#if 0 -#include "c.h" -#endif - +#include +#include +#include #include -#include #include +#include #include #include -#include -#include #include "pool_parser.h" #include "stringinfo.h" #include "utils/palloc.h" ----Next_Part(Wed_Sep_17_19_47_36_2025_008)----