How can I get the identifier cross reference for code C99?

I support several C moderately sized programs, and I often use cross-references for complete, accurate information. Unlike “tags” or other approximations, such information is usually generated by a compiler who knows the complete rules for determining the area of ​​the C language and can provide accurate information accordingly. For example, here is a snippet of information obtained from the compiler lcc:

function eval src=scheme.nw:4101.0 use=scheme.nw:4101.0
  use=scheme.nw:4174.35 use=scheme.nw:4334.11 use=scheme.nw:4335.11
  use=scheme.nw:4337.11 use=scheme.nw:4340.14 use=scheme.nw:4341.4
  use=scheme.nw:4351.12 use=scheme.nw:4305.32 use=scheme.nw:4324.29
  use=scheme.nw:4278.7 use=scheme.nw:4201.8 use=scheme.nw:4234.11
  type=struct Value function(pointer to struct Exp,pointer to incomplete
  struct Env defined at scheme.nw:3889) sclass=auto scope=GLOBAL flags=0
  ref=3.710000 ncalls=46

This tells me that the function evalis defined in the source file scheme.nw, line 4101, column 0, and it lists all the places in which it is used eval.

My problem: it lccworks only for ANSI C, and most of my projects migrate to C99. Which compiler or tool will provide completely accurate cross-reference information for C99 programs?

Linux support is needed; free software would be nice, but not necessary.

+3
source share
1 answer

The Clang index library seems like a pretty decent candidate. I personally have not conducted any serious conformance testing, but they claim that the only missing C99 features are floating point pragmas (which shouldn’t affect the generation of cross-references).

+3

Source: https://habr.com/ru/post/1737613/


All Articles