[1/1] package/xinetd: fix build w/ gcc-14

Message ID 20251226171313.1982585-1-dario.binacchi@amarulasolutions.com
State New
Headers show
Series
  • [1/1] package/xinetd: fix build w/ gcc-14
Related show

Commit Message

Dario Binacchi Dec. 26, 2025, 5:13 p.m. UTC
Building xinetd with gcc-14 raises the following error:

cvt.c: In function 'fcvt_r':
cvt.c:113:9: error: implicit declaration of function 'strx_nprint' [-Wimplicit-function-declaration]
  113 |     n = strx_nprint (buf, len, "%.*" FLOAT_FMT_FLAG "f", ndigit, value);
      |

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 ...libs-src-portable-fix-build-w-gcc-14.patch | 46 +++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 package/xinetd/0006-libs-src-portable-fix-build-w-gcc-14.patch

Comments

'Rob Herring (Arm)' via Amarula Linux Jan. 1, 2026, 3:52 p.m. UTC | #1
Hello Dario,

On Fri, 26 Dec 2025 18:13:13 +0100
Dario Binacchi <dario.binacchi@amarulasolutions.com> wrote:

> Building xinetd with gcc-14 raises the following error:
> 
> cvt.c: In function 'fcvt_r':
> cvt.c:113:9: error: implicit declaration of function 'strx_nprint' [-Wimplicit-function-declaration]
>   113 |     n = strx_nprint (buf, len, "%.*" FLOAT_FMT_FLAG "f", ndigit, value);
>       |
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
>  ...libs-src-portable-fix-build-w-gcc-14.patch | 46 +++++++++++++++++++
>  1 file changed, 46 insertions(+)
>  create mode 100644 package/xinetd/0006-libs-src-portable-fix-build-w-gcc-14.patch

Thanks for your patch. Unfortunately, I discovered it only after
applying a patch from Bernd bumping xinetd to a newer version that
already fixes this. That being said, your patch would have been a much
better solution for 2025.02.x, so I've pointed it out to the LTS
maintainers, so that they might be taking it instead of the version
bump to fix xinetd in 2025.02.x.

Thanks a lot,

Thomas

Patch

diff --git a/package/xinetd/0006-libs-src-portable-fix-build-w-gcc-14.patch b/package/xinetd/0006-libs-src-portable-fix-build-w-gcc-14.patch
new file mode 100644
index 000000000000..8bfbcd6d8ddf
--- /dev/null
+++ b/package/xinetd/0006-libs-src-portable-fix-build-w-gcc-14.patch
@@ -0,0 +1,46 @@ 
+From 499087df7c0aaa01f0f64aa7aa355d2e543665bc Mon Sep 17 00:00:00 2001
+From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
+Date: Wed, 24 Dec 2025 11:36:20 +0100
+Subject: [PATCH] libs/src/portable: fix build w/ gcc-14
+
+Building xinetd with gcc-14 in Buildroot raises the following error:
+
+cvt.c: In function 'fcvt_r':
+cvt.c:113:9: error: implicit declaration of function 'strx_nprint' [-Wimplicit-function-declaration]
+  113 |     n = strx_nprint (buf, len, "%.*" FLOAT_FMT_FLAG "f", ndigit, value);
+      |         ^~~~~~~~~~~
+
+Including "str.h" header to fix the compiler error would add a
+build-time dependency of libportable on libstr, creating a circular
+dependency chhain:
+
+  libportable -> libstr -> libsio -> libportable
+
+which results in GNU make dropping dependency edges and therefore not
+fixing the original build error.
+
+The commit keeps the existing library layering unchanged while restoring
+successful builds with modern compilers.
+
+Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
+Upstream: https://github.com/xinetd-org/xinetd/pull/39
+---
+ libs/src/portable/cvt.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/libs/src/portable/cvt.c b/libs/src/portable/cvt.c
+index 4bd99fc80c26..4badab1cbd42 100644
+--- a/libs/src/portable/cvt.c
++++ b/libs/src/portable/cvt.c
+@@ -64,6 +64,8 @@
+ #endif
+ 
+ #ifndef HAVE_FCVT
++int strx_nprint ( char *buf, int len, const char *fmt, ... );
++
+ int
+ APPEND (FUNC_PREFIX, fcvt_r) (FLOAT_TYPE value, 
+                               int ndigit, 
+-- 
+2.43.0
+