Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make use of stdbool.h when generating Python interface #244

Merged
merged 1 commit into from
Feb 22, 2022

Conversation

flyn-org
Copy link
Contributor

It seems building pocketsphinx 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 pocketsphinx_wrap.c:11:
pocketsphinx_wrap.c:16:13: error: two or more data types in declaration specifiers
16 | typedef int bool;
| ^~~~
pocketsphinx_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 [email protected]

It seems building pocketsphinx 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 pocketsphinx_wrap.c:11:
pocketsphinx_wrap.c:16:13: error: two or more data types in declaration specifiers
   16 | typedef int bool;
      |             ^~~~
pocketsphinx_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 <[email protected]>
@lenzo-ka lenzo-ka merged commit 5da71f0 into cmusphinx:master Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants