public inbox for [email protected]
help / color / mirror / Atom feedCompiling issues for 32-bit targets
2+ messages / 1 participants
[nested] [flat]
* Compiling issues for 32-bit targets
@ 2025-09-17 10:47 Tatsuo Ishii <[email protected]>
2025-09-17 23:58 ` Re: Compiling issues for 32-bit targets Tatsuo Ishii <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Tatsuo Ishii @ 2025-09-17 10:47 UTC (permalink / raw)
To: [email protected]; +Cc: [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.
Best regards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp
Attachments:
[text/x-patch] snprintf.patch (826B, 2-snprintf.patch)
download | inline diff:
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 <ctype.h>
+#include <errno.h>
+#include <math.h>
#include <stdarg.h>
-#include <stdio.h>
#include <stdint.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
-#include <errno.h>
#include "pool_parser.h"
#include "stringinfo.h"
#include "utils/palloc.h"
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Compiling issues for 32-bit targets
2025-09-17 10:47 Compiling issues for 32-bit targets Tatsuo Ishii <[email protected]>
@ 2025-09-17 23:58 ` Tatsuo Ishii <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Tatsuo Ishii @ 2025-09-17 23:58 UTC (permalink / raw)
To: [email protected]; +Cc: [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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2025-09-17 23:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-09-17 10:47 Compiling issues for 32-bit targets Tatsuo Ishii <[email protected]>
2025-09-17 23:58 ` Tatsuo Ishii <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox