Using pycparser==2.21, I get a ParseError when processing a variable of type pid_t. I'm working with some C source I don't control and would like to avoid forking/editing if possible.
I haven't taken a look at pycparser's internals to know how types are derived but I wonder if there's a way to alias pid_t to int.
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/cffi/cparser.py", line 336, in _parse
ast = _get_parser().parse(fullcsource)
File "/usr/local/lib/python3.7/dist-packages/pycparser/c_parser.py", line 150, in parse
debug=debug)
File "/usr/local/lib/python3.7/dist-packages/pycparser/ply/yacc.py", line 331, in parse
return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
File "/usr/local/lib/python3.7/dist-packages/pycparser/ply/yacc.py", line 1199, in parseopt_notrack
tok = call_errorfunc(self.errorfunc, errtoken, self)
File "/usr/local/lib/python3.7/dist-packages/pycparser/ply/yacc.py", line 193, in call_errorfunc
r = errorfunc(token)
File "/usr/local/lib/python3.7/dist-packages/pycparser/c_parser.py", line 1934, in p_error
column=self.clex.find_tok_column(p)))
File "/usr/local/lib/python3.7/dist-packages/pycparser/plyparser.py", line 67, in _parse_error
raise ParseError("%s: %s" % (coord, msg))
pycparser.plyparser.ParseError: <cdef source string>:3:5: before: pid_t
Using
pycparser==2.21
, I get aParseError
when processing a variable of typepid_t
. I'm working with some C source I don't control and would like to avoid forking/editing if possible.I haven't taken a look at
pycparser
's internals to know how types are derived but I wonder if there's a way to aliaspid_t
toint
.