Skip to content

A simple compiler wrapper for capturing source files for Facebook Infer

Notifications You must be signed in to change notification settings

TomasBeranek/infer-compiler-wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Compiler wrapper for Facebook Infer

A script that wraps C/C++ compilers to capture the compilation commands that are used to run the capture phase of Infer.

Usage

Clone the repository:

git clone https://github.com/TomasBeranek/infer-compiler-wrapper
cd infer-compiler-wrapper

Make sure the wrapper is executable:

sudo chmod +x wrapper

On line 4, add the name of the compiler, e.g. for gcc the line should look like this:

compiler="gcc"

Replace the compiler with the wrapper and rename the compiler to [COMPILER]-original, e.g. for gcc:

sudo mv /usr/bin/gcc /usr/bin/gcc-original
sudo cp wrapper /usr/bin/gcc

Compile the analyzed project. Source files that are not compiled will not be captured and therefore not analyzed!

Captured files are stored in /tmp/infer-out by default.

Finally, run the analysis, e.g.:

infer analyze --pulse --bufferoverrun -o /tmp/infer-out