Skip to content

4144/paranucker

Repository files navigation

Paranoid null checker (paranucker) - static code analyser for C/C++

This is gcc plugin for dump AST tree and search possible null pointers.

Version 1.0 Date: 2015-06-22

Build deps

  • gcc 5 with plugin includes. (gcc-5-plugin) For older gcc build possible, but need change make file.
  • automake/autoconf.

Run time deps

  • gcc 5 / g++ 5 or older.

Features

  • Dump AST tree from gcc.
  • Search missing basic null pointer checks for function input parameters.
  • Dont check parameters with attribute NONNULL.
  • In future probably other checks...

Build

  • Run build.sh
  • You will get paranucker.so for gcc binary and cxxparanucker.so for g++ binary

Usage examples

In directory examples present two examples one for C++ and other for C.

Real world usage examples

Advanced usage

Paranoid null checker support one plugin paramater named -fplugin-arg-paranucker-command or -fplugin-arg-cxxparanucker-command depend what you using C or C++

Example: gcc-5 -fplugin=../paranucker.so -fplugin-arg-paranucker-command=detectnullpointers

Known parameter values:

name action
parse silently parse AST
dump dump whole AST
smalldump small AST dump without indention
memoryusage show how many nodes parsed
dumpunsupported dump nodes what cant be parsed
findargs dump functions and argument names what can be checked
detectnullpointers search null pointers
dumpnullpointers search null pointers and dump some debug info

Readme on russian README.ru.md

About

paranoid static code analyzer for C/C++ (mirror)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published