Static analysis should be done on link/archive time so it can work across whole program and libraries at a time. It should also analyze linked libraries and their dependencies, although only if it's functionality is used (similar to how headers work now).
A number of things is missing for this to be supported:
The analyzer must work on multiple compilation units.
The analyzer must know of some the compilation options (especially preprocessor defines and include paths) on all compilation units.
The analyzer must have access to the source of the compilation units.
Debug information could give the analyzer access to the source of the compilation units. I don't know if the debug information can give you the required compilation options. If not, this information would have to be stored somewhere (probably as a DWARF extension) and ccc-analyzer could append that information to object files.
Extended Description
Static analysis should be done on link/archive time so it can work across whole program and libraries at a time. It should also analyze linked libraries and their dependencies, although only if it's functionality is used (similar to how headers work now).
A number of things is missing for this to be supported:
Debug information could give the analyzer access to the source of the compilation units. I don't know if the debug information can give you the required compilation options. If not, this information would have to be stored somewhere (probably as a DWARF extension) and ccc-analyzer could append that information to object files.