0

I'm writing some C code using a library but the documentation is outdated. So if I need to find all fields available for the "super_struct" type for example, how would I go about finding that out without digging through hundreds of header files whilst mentally keeping track of the preprocessor?

GCC seems to know pretty immediately what fields are available for the struct as it's the one giving me the error. So there must be a way for gcc to spit out the actual typedef of the struct.

Something like gcc main.c --printsymbol=super_struct would be great.

  • 1
    `gcc -E main.c -o main.pp` will give you the preprocessed output. Then open `main.pp` and look for the struct definition. Is that what you need? – kaylum Jan 17 '21 at 21:59
  • Maybe [this](https://stackoverflow.com/a/31949082/2233706) – user2233706 Jan 17 '21 at 22:23
  • 1
    Not an answer, but honest advice - if you don't have/use an editor or IDE that can quickly search through "*hundreds of header files*" then find a better one. – dxiv Jan 17 '21 at 22:42

0 Answers0