Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.bugs.dist > #1270138 > unrolled thread
| Started by | Dominik Viererbe <dominik.viererbe@canonical.com> |
|---|---|
| First post | 2025-11-14 14:50 +0100 |
| Last post | 2025-11-18 20:30 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.debian.bugs.dist
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Bug#1097917: Patch for sphinxbase: ftbfs with GCC-15 Dominik Viererbe <dominik.viererbe@canonical.com> - 2025-11-14 14:50 +0100
Bug#1097917: Patch for sphinxbase: ftbfs with GCC-15 Adrian Bunk <bunk@debian.org> - 2025-11-18 20:30 +0100
| From | Dominik Viererbe <dominik.viererbe@canonical.com> |
|---|---|
| Date | 2025-11-14 14:50 +0100 |
| Subject | Bug#1097917: Patch for sphinxbase: ftbfs with GCC-15 |
| Message-ID | <LR2lz-cUYt-3@gated-at.bofh.it> |
Like the error message already says, the source can not be compiled,
because it defines the type 'bool' and 'bool' is a keyword with
'-std=c23' onwards. To fix this we can either remove the typedef or
check if __STDC_VERSION__ < 202311L, see patch below. I tested this
patch on Ubuntu resolute.
--- a/swig/sphinxbase.i
+++ b/swig/sphinxbase.i
@@ -74,10 +74,12 @@
%begin %{
#ifndef __cplusplus
+#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 202311L)
typedef int bool;
#define true 1
#define false 0
#endif
+#endif
#include <sphinxbase/cmd_ln.h>
#include <sphinxbase/err.h>
[toc] | [next] | [standalone]
| From | Adrian Bunk <bunk@debian.org> |
|---|---|
| Date | 2025-11-18 20:30 +0100 |
| Message-ID | <LSzyN-dXc2-3@gated-at.bofh.it> |
| In reply to | #1270138 |
On Fri, Nov 14, 2025 at 03:41:33PM +0200, Dominik Viererbe wrote:
> Like the error message already says, the source can not be compiled,
> because it defines the type 'bool' and 'bool' is a keyword with
> '-std=c23' onwards. To fix this we can either remove the typedef or
> check if __STDC_VERSION__ < 202311L, see patch below. I tested this
> patch on Ubuntu resolute.
>
> --- a/swig/sphinxbase.i
> +++ b/swig/sphinxbase.i
> @@ -74,10 +74,12 @@
> %begin %{
> #ifndef __cplusplus
> +#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 202311L)
> typedef int bool;
> #define true 1
> #define false 0
> #endif
> +#endif
> #include <sphinxbase/cmd_ln.h>
> #include <sphinxbase/err.h>
This patch might work, but it is not a good solution.
When anything using a typedef'ed bool was part of an ABI (rare,
but cases exist), then using C23 bool instead would break ABI.
Otherwise stdbool.h works with all standards >= C99.
Upstream used the latter to fix it:
https://github.com/cmusphinx/sphinxbase/commit/7397d13fcc56b0a304611a4d2c598eaf1177df2d
cu
Adrian
[toc] | [prev] | [standalone]
Back to top | Article view | linux.debian.bugs.dist
csiph-web