Is there a way to get warned about unused functions?

Caolan Mc Namara, a LibreOffice developer, has made a small tool to detect this type of thing in LibreOffice source code. They had around thousands functions & methods unused in LibreOffice. His tool is a key element for removing them.

It’s called callcatcher. It can

collect functions/methods defined and subtract called/referenced

It works directly on assembler output and so, it works only for x86 and x86_64 architecture. It can produce output like this. You can integrate it with your traditional compiling and linking call to gcc.

Caolan agrees that it should become a gcc plugin.

Leave a Comment