An open API service indexing awesome lists of open source software.

https://github.com/schani/undefinder

Finds unused C #defines.
https://github.com/schani/undefinder

Last synced: 3 months ago
JSON representation

Finds unused C #defines.

Awesome Lists containing this project

README

        

# Undefinder

Undefinder is a small utility that searches C codebases for unused
preprocessor `#define`s.

Its biggest shortcoming is that it doesn't understand comments, so it
will treat commented out macros as defined, and it will treat textual
occurrences of macros in comments as uses.

## Usage

Requires [go](https://golang.org/).

go run undefinder.go --exclude-defines="dont-report.c" /my/c/codebase

The output can be parsed like C compiler errors/warnings.