Skip to content

GLIBChecker is a tool designed to check the usage of LibC functions in a C++ projects.

Notifications You must be signed in to change notification settings

Clement-Z4RM/GLIBChecker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔎 GLIBChecker

GLIBChecker is a tool designed to check the usage of LibC functions in a C++ project.

It checks if there are LibC functions in your binary which are used without namespace in your code. It also checks if you are using exit (see Features to ignore it).

👨‍💻 Run Locally

Prerequisites

  • ripgrep
  • nm (should be installed on your system by default)
  • CMake (if you want to compile by yourself, 3.27 or higher*)

*if you have lower version, you can try to change the first line of CMakeLists.txt with your version

Clone the project (or get it in releases)

git clone https://github.com/Clement-Z4RM/GLIBChecker.git

Go to the project directory

cd GLIBChecker

Install the binary

make install

If your cmake executable is not in your PATH, you can do:

make install CMAKE=<your cmake path>

Launch it with binary file as argument

glib_checker <binary>

✨ Features

Ignore files, functions,...:

Set GLIBCHECKER_IGNORE environment variable with files, function,... like this:

GLIBCHECKER_IGNORE="./src/Foo.cpp" glibchecker foo

Here are the patterns taken into account:

  • Function (e.g.: "foo")
  • File (e.g.: "./src/Foo.cpp")
  • Folder (e.g.: "./src/")
  • File:Line (e.g.: "./src/Foo.cpp:42")
  • File:Function (e.g.: "./src/Foo.cpp:foo")
  • File:Line:Function (e.g.: "./src/Foo.cpp:42:foo") The file must be relative to your current directory, and must have the same format as in the GLIBChecker output.

Patterns must be space-separated.

Run in GitHub Actions:

You can use this tool in your GitHub Actions workflow. To have the error message in the GitHub Actions summary, you can set the GLIBCHECKER_GH_ACTIONS environment variable:

GLIBCHECKER_GH_ACTIONS= glib_checker <binary>

🐛 Bug Reports

If you find a bug, you can report it creating an issue or fix it creating a pull request.

➕ Contributing

Contributions are always welcome!

You can open an issue or create a pull request.

Also, you can check the to-do list to see planned features.

👱 Authors

About

GLIBChecker is a tool designed to check the usage of LibC functions in a C++ projects.

Resources

Stars

Watchers

Forks