Skip to content
This repository was archived by the owner on Jun 9, 2022. It is now read-only.

Make use of stdbool.h when generating Python interface - #90

Merged
lenzo-ka merged 1 commit into
cmusphinx:masterfrom
flyn-org:stdbool
Feb 21, 2022
Merged

lenzo-ka merged 1 commit into
cmusphinx:masterfrom
flyn-org:stdbool

Conversation

@flyn-org

Copy link
Copy Markdown
Contributor

It seems building sphinxbase does not work with Python's 3.11
series. Trying to compile fails with this error:

In file included from /usr/include/python3.11/cpython/pystate.h:5,
from /usr/include/python3.11/pystate.h:135,
from /usr/include/python3.11/Python.h:76,
from sphinxbase_wrap.c:11:
sphinxbase_wrap.c:16:13: error: two or more data types in declaration specifiers
16 | typedef int bool;
| ^~~~
sphinxbase_wrap.c:16:1: warning: useless type name in empty declaration
16 | typedef int bool;
| ^~~~~~~

My guess is that one of the Python header files started including
stdbool.h, and thus the type bool conflicts with the name bool in:

typedef int bool;

The offending code is generated using swig.

This commit removes the definition of bool and instead includes
stdbool.h to make use of the system definition.

Signed-off-by: W. Michael Petullo mike@flyn.org

It seems building sphinxbase does not work with Python's 3.11
series. Trying to compile fails with this error:

In file included from /usr/include/python3.11/cpython/pystate.h:5,
                 from /usr/include/python3.11/pystate.h:135,
                 from /usr/include/python3.11/Python.h:76,
                 from sphinxbase_wrap.c:11:
sphinxbase_wrap.c:16:13: error: two or more data types in declaration specifiers
   16 | typedef int bool;
      |             ^~~~
sphinxbase_wrap.c:16:1: warning: useless type name in empty declaration
   16 | typedef int bool;
      | ^~~~~~~

My guess is that one of the Python header files started including
stdbool.h, and thus the type bool conflicts with the name bool in:

typedef int bool;

The offending code is generated using swig.

This commit removes the definition of bool and instead includes
stdbool.h to make use of the system definition.

Signed-off-by: W. Michael Petullo <mike@flyn.org>
@lenzo-ka
lenzo-ka merged commit 3612ab4 into cmusphinx:master Feb 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants