You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for this library! I'm having great fun using it to nitpick some code.
Attempting to parse a function declaration with an unnamed static array:
from pycparser.c_parser import CParser
CParser().parse('void f(int [static 10]);')
fails with:
File "/usr/local/lib/python3.9/site-packages/pycparser/plyparser.py", line 67, in _parse_error
raise ParseError("%s: %s" % (coord, msg))
pycparser.plyparser.ParseError: :1:13: before: static
If we name the argument -- i.e. (int x[static 10]) -- then it works fine (since the example would be exactly the same as #21, the issue which prompted support for static arrays in the first place). Omitting the argument name is valid in C99.
I'm using pycparser 2.22. Thanks again for this library!
The text was updated successfully, but these errors were encountered:
This is similar to:
allow "static" in array parameters (GH issue eliben#21)
aac7b27
which was revised shortly after in:
Fuller support for qualifiers in array dimensions.
8aad318
The grammar is as defined in C99 6.7.6 Type names, or
A.2.2 Declarations (6.7.6).
Thanks for this library! I'm having great fun using it to nitpick some code.
Attempting to parse a function declaration with an unnamed static array:
fails with:
If we name the argument -- i.e.
(int x[static 10])
-- then it works fine (since the example would be exactly the same as #21, the issue which prompted support for static arrays in the first place). Omitting the argument name is valid in C99.I'm using pycparser 2.22. Thanks again for this library!
The text was updated successfully, but these errors were encountered: