-
Notifications
You must be signed in to change notification settings - Fork 35
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
parse error with Macosx #68
Comments
Are you sending the content of the system file |
To complete my answer: maybe you are extracting and pre-processing the C system header manually and then sending it to |
is there any way to fix this code (helping irmen on this)
|
The issue you're facing, I would say, is that `cpp -nostdinc -E -P` on your
mac somehow still includes `
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/arm/_types.h`.
This doesn't make sense; see `-nostdinc` in `man cpp`. I may be wrong and
misinterpreting the error you report. Or else `cpp` on mac is just not the
one from GNU at all, and it doesn't interpret the options the same way.
Maybe it's some thin wrapper around a tool from clang?
You should try to manually run `cpp -nostdinc -E -P
/usr/include/binaryen-c.h` (or maybe `/usr/local/include/binaryen-c.h`) and
inspect the result. It should definitely not mention `/Library/Developer`
at all.
Maybe try the `clang-format` alternative given as a comment in your Python
file?
Message ID: ***@***.***>
… |
Traceback (most recent call last):
File "/Users/louismcmaster/PycharmProjects/pythonProject/.venv/lib/python3.12/site-packages/cffi/cparser.py", line 336, in _parse
ast = _get_parser().parse(fullcsource)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/louismcmaster/PycharmProjects/pythonProject/.venv/lib/python3.12/site-packages/pycparser/c_parser.py", line 147, in parse
return self.cparser.parse(
^^^^^^^^^^^^^^^^^^^
File "/Users/louismcmaster/PycharmProjects/pythonProject/.venv/lib/python3.12/site-packages/pycparser/ply/yacc.py", line 331, in parse
return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/louismcmaster/PycharmProjects/pythonProject/.venv/lib/python3.12/site-packages/pycparser/ply/yacc.py", line 1199, in parseopt_notrack
tok = call_errorfunc(self.errorfunc, errtoken, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/louismcmaster/PycharmProjects/pythonProject/.venv/lib/python3.12/site-packages/pycparser/ply/yacc.py", line 193, in call_errorfunc
r = errorfunc(token)
^^^^^^^^^^^^^^^^
File "/Users/louismcmaster/PycharmProjects/pythonProject/.venv/lib/python3.12/site-packages/pycparser/c_parser.py", line 1931, in p_error
self._parse_error(
File "/Users/louismcmaster/PycharmProjects/pythonProject/.venv/lib/python3.12/site-packages/pycparser/plyparser.py", line 67, in _parse_error
raise ParseError("%s: %s" % (coord, msg))
pycparser.plyparser.ParseError: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/arm/_types.h:76:27: before: __darwin_va_list
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/louismcmaster/PycharmProjects/pythonProject/binaryentst.py", line 1, in
import binaryen
File "/Users/louismcmaster/PycharmProjects/pythonProject/.venv/lib/python3.12/site-packages/binaryen.py", line 78, in
ffi.cdef(parse_header_file())
File "/Users/louismcmaster/PycharmProjects/pythonProject/.venv/lib/python3.12/site-packages/cffi/api.py", line 112, in cdef
self._cdef(csource, override=override, packed=packed, pack=pack)
File "/Users/louismcmaster/PycharmProjects/pythonProject/.venv/lib/python3.12/site-packages/cffi/api.py", line 126, in _cdef
self._parser.parse(csource, override=override, **options)
File "/Users/louismcmaster/PycharmProjects/pythonProject/.venv/lib/python3.12/site-packages/cffi/cparser.py", line 389, in parse
self._internal_parse(csource)
File "/Users/louismcmaster/PycharmProjects/pythonProject/.venv/lib/python3.12/site-packages/cffi/cparser.py", line 394, in _internal_parse
ast, macros, csource = self._parse(csource)
^^^^^^^^^^^^^^^^^^^^
File "/Users/louismcmaster/PycharmProjects/pythonProject/.venv/lib/python3.12/site-packages/cffi/cparser.py", line 338, in _parse
self.convert_pycparser_error(e, csource)
File "/Users/louismcmaster/PycharmProjects/pythonProject/.venv/lib/python3.12/site-packages/cffi/cparser.py", line 367, in convert_pycparser_error
raise CDefError(msg)
cffi.CDefError: parse error
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/arm/_types.h:76:27: before: __darwin_va_list
cffi 16.00
Macbook pro
The text was updated successfully, but these errors were encountered: