public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tatsuo Ishii <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: Re: Compiling issues for 32-bit targets
Date: Thu, 18 Sep 2025 08:58:16 +0900 (JST)
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

> Gyorgy Sarvari <[email protected]> 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 '<math.h>' or provide a declaration of 'isnan'
>> |    49 | #include "postgresql/server/port.h"
>> |   +++ |+#include <math.h>
>> |    50 |
>> | snprintf.c:1254:21: error: implicit declaration of function 'isinf' [-Wimplicit-function-declaration]
>> |  1254 |                 if (isinf(value))
>> |       |                     ^~~~~
>> | snprintf.c:1254:21: note: include '<math.h>' 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 <math.h>" 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






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], [email protected]
  Subject: Re: Compiling issues for 32-bit targets
  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