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

pycparser.plyparser.ParseError: test.c:2:15: before: mallocFunc #28

Open
jiffe opened this issue Apr 19, 2017 · 1 comment
Open

pycparser.plyparser.ParseError: test.c:2:15: before: mallocFunc #28

jiffe opened this issue Apr 19, 2017 · 1 comment

Comments

@jiffe
Copy link

jiffe commented Apr 19, 2017

I am trying to parse some code which includes libxml2 and it seems to fail on

typedef void *(__attribute__((alloc_size(1))) *xmlMallocFunc)(long unsigned int size);
xmlMallocFunc mallocFunc;

If I take out the __attribute__((alloc_size(1))) this parses fine. I added debug statements and one thing I noticed different was when it worked I saw

Stack : decl_body SEMI . LexToken(TYPEID,'xmlMallocFunc',2,120)

and when it did not work I saw

Stack : decl_body SEMI . LexToken(ID,'xmlMallocFunc',2,151)

the difference being TYPEID vs ID. I'm not sure if this is the root of the problem but I'm not sure where the ID is coming from vs TYPEID and was hoping you could help me here.

@inducer
Copy link
Owner

inducer commented Apr 19, 2017

I don't have much time to work on this, but I'd be happy to take a patch. A reduced reproducer might help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants