-
Notifications
You must be signed in to change notification settings - Fork 611
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
make pycparser work with linux kernel code #513
Comments
I'm not sure this file was generated after preprocessing with the fake headers. I see no menion of "fake" in that file, and I'd expect to see many if indeed the fake headers were added with Another piece of evidence is that the fake headers actually include fake typedefs for For example, if you run from the root directory of
You will see the preprocessing pull stuff from the fake headers, including |
So sorry. Uploaded the wrong file. Here it is: the compiling commands is the following: There were warnings of redefinition. However, the linux header includes have to be there. Otherwise it won't compile. |
You have to plow through the issues one by one. The Linux kernel is not - to the best of my knowledge - trying to be "standard C99", so it has some duplicate definitions and so on. You can move the If I had time to go through the whole exercise now, I would try to create a separate version of the fake headers fine-tuned for the linux kernel, and knock the problems out one by one. There could be more difficult issues ahead like specific GNU extensions used by the kernel code which pycparser does not support, though. |
okay, got it. Thanks very much! |
Hi Eli,
Thanks for the information provided. I image it will be challenging task and tried quite a few different ways but without success.
Attached is a standard pre-compiled arch/x86/boot/cpu.c file cpu_pp.log which compiled with the fake lib headers. When running pycparser against that file, I got pycparser.plyparser.ParseError: xxx/kernel-source/include/linux/stdarg.h:5:27: before: va_list.
I think I am missing something because va_list is a gcc symbol and it should be recognised. Can you please have a quick look?
cpu_pp.log
Sorry, I was going to attach to the other ticket but it was closed. But really appreciated!
The text was updated successfully, but these errors were encountered: