Skip to content

maijun-sec/custom-csa-rule-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

custom-csa-rule-example

Prerequisites

  • gcc 9.x + cmake + make
  • llvm + clang 15.0.7

Build with cmake

mkdir build && cd build
cmake -DLLVM_DIR=${LLVM_INSTALL_PATH}/lib/cmake/llvm ..
make -j8

Usage

use as plugin

# view a list of native rules supported by clang
clang -cc1 -analyzer-checker-help

# view the list of native rules and user-defined rules supported by Clang.
# In the following command, -load is the path of the SO library of the user-defined rule.
clang -cc1 -analyzer-checker-help -load xx.so

# perform analysis. Pay attention to the values of the following parameters:
# The value of -fplugin is the path of the SO library of the generated user-defined rule. You can also use -load xx.so.
# -analyzer-checker is followed by a list of rules to be used.
clang -c --analyzer -fplugin=xx.so -Xanalyzer -analyzer-checker=checker-list

Licenses

The code for this project is released under an Apache 2.0 License (included in the LICENSE file in the root directory of the project).

This project may use some other clang static analyzer rules, for these rules, will use original license.

  • MainCallChecker: copy from original llvm-project, Apache 2.0

Reference

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published