eliben / pycparser

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

Parser can't handle unknown data types for variables #536

Closed leninnr closed 4 months ago

leninnr commented 4 months ago

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

#include <stdio.h> 
int main(void) {     
  hse_poll_res a = TRUE;   /* This is an example of a unknown data type  */
  return 0;
}
leninnr commented 4 months ago

I attempted to work around the problem here: https://github.com/aerah8/pycparser/blob/main/pycparser/preprocessing.py (copy and paste the link into the search bar to find the actual file) The function is: find_undefined_types_in_variables(code_list)