Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7877237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:18:37+00:00 2026-06-03T03:18:37+00:00

Using pycparser to parse a slew of .c source files, but the parser can’t

  • 0

Using pycparser to parse a slew of .c source files, but the parser can’t handle many things in the #included libraries, and I really don’t need them for my purposes. I don’t need to have it compile, just need to generate the AST from the specific .c I’m processing.
The cpp args i’m passing it right now are:

cpp_args=["-D__attribute__=","-D__extension__=","-D__builtin_va_list=void*"]

Any ideas?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T03:18:38+00:00Added an answer on June 3, 2026 at 3:18 am

    Try specifying the -nostdinc option to the preprocessor (and make sure you’re not passing any -I options). Given this input in foo.c:

    #include <stdio.h>
    #include <stdlib.h>
    #include <unistd.h>
    
    int main(int argc, char **argv) {
            return 0;
    }
    

    Running:

    cpp -nostdinc foo.c
    

    Gives me:

    # 1 "foo.c"
    # 1 "<built-in>"
    # 1 "<command-line>"
    # 1 "foo.c"
    
    
    
    
    int main(int argc, char **argv) {
     return 0;
    }
    

    And the following errors:

    foo.c:1:19: error: no include path in which to search for stdio.h
    foo.c:2:20: error: no include path in which to search for stdlib.h
    foo.c:3:20: error: no include path in which to search for unistd.h
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using a 2 processes Pool to parallel parse several log files, po =
Using JAVA, I'm trying to force the browser to download files. Here is the
I'm trying to parse some text using PyParser. The problem is that I have
Using the navigator.geolocation object in JavaScript. Trying to establish accurate ranges, but wondering exactly
Using jQuery, one can easily find out whether a particular element is visible using
Using pyparser, I am trying to create a very simple parser for the S-Expression
Using Android TelephonyManager an application can obtain the state of data activity over the
Using Delphi 2010. I am looking for (possibly) a function or procedure which can
Using Xcode4.2.1, with a basic PhoneGap template based app. (I say template, but I
Using Github's Issue Tracker, how can one create an issue tied to an organization

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.