Closed retif closed 3 months ago
May be the issue there that locale_t is considered as LexToken(ID,'locale_t',4700,151793) instead LexToken(TYPEID,'locale_t',4700,151793)
I see that the type definition of "locale_t" is not present in the content provided to .parse() method
This is likely relevant: https://eli.thegreenplace.net/2015/on-parsing-c-type-declarations-and-fake-headers
Please double check that all types are defined
https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2997
As I see the issue which I faced with pipewire-py project(which with the help of pycparser generates bindings from c to py) is coming from standard locale_t type not being included. It seems should be implicitly included by the compiler(some of, some standard of), but in our case we dont use compiler at all. We just pack all includes and trying to parse them.
Not sure how that worked for original package developer.
And its clearly not an pycparser issue. Its preprocessing issue.
The only thing I could wish from pycparser is to give more informative error when user trying to parse undefined types or variables. If it falls, why not to fall a bit more gracefully 😊
Static variable declaration
from the function
causes parser to fail.
At yacc.py:1070
t is resolved to None value
Output with debuglevel=1