eliben / pycparser

:snake: Complete C99 parser in pure Python
Other
3.21k stars 612 forks source link

Parser unbale to handle custom data types for custom functions #537

Closed bryanthomaas closed 4 months ago

bryanthomaas commented 4 months ago

The following c file will generate a pycparser.plyparser.ParseError

static uint64_t rbuf_hash_cb(void *instance, void *env) {
    rbuf *r = (rbuf *)instance;
    (void)env;
    return theft_hash_onepass(r->buf, r->size);
}
bryanthomaas commented 4 months ago

I attempted a work around for the problem: https://github.com/aerah8/pycparser/blob/main/pycparser/preprocessing.py (copy the link and paste in search bar to find the actual file)

The name of the function is find_undefined_function_types(code_list)