Skip to content

Latest commit

 

History

History
31 lines (28 loc) · 907 Bytes

README.md

File metadata and controls

31 lines (28 loc) · 907 Bytes

c_parser

sample output

Requirement

libclang

Install python libaray

$ pip install libclang

  • If env is not setup properly, one need to specify libclang.so(linux) libclang.dll(windows) using clang.cindex.Config.set_library_path('/path/to/libclang') in StaticCodeAnalyizer.py
  • Site: https://pypi.org/project/libclang/

graphviz

Install python libaray

$ pip install graphviz

How to use

config = {
    # project name
    'project' : 'sample project',
    # target dir
    'dirs' : ['sample'],
    # target files
    'files' : ['code.c'],
    # build option
    'build_options' : ['-E', '-fsyntax-only', '-DMODULE', '-Isample'],
    # functions to exlcude from analysis
    'ignore_func_list' : ['likely', 'unlikely', 'WARN', 'WARN_ON', 'BUG', 'BUG_ON']
}