Introduction to use c-summary via Docker image yhuai/c-summary-image

Prerequisite

Instructions

To start the container, run

To capture C/C++ code via Infer, run

Please remember to substitute #FILE_NAME_HERE with actual file, for example, sample.c

Features provided by c-summary

  1. Pre-analysis to calculate alias relations

  2. Pre-analysis to construct a global environment

  3. Main-analysis to extract semantic summaries

  4. Post-analysis for global variables

  5. Transform sematic summary to Java methods

Example

You can find a simple example at /home/sample, which includes a simple JNI program sample.c, and a bash script run.sh.

You can test c-summary by using the commands above, or you can use

which executes these commands.

After execution, you should be able to find generated Java files at /home/sample/java-gen-out