Saint-Martin
Saint-Martin

Reputation: 316

Warning for unused member functions

While developing my software, I declared many class functions that are not called anymore.

Now, I would like to tidy my sources, and get rid of those declarations.

GCC can detect unused variables, but is there a GCC option to detect unused class functions ? Or do I need upgrade for this (4.9.2) ?

Upvotes: 1

Views: 590

Answers (1)

Fabian Keßler
Fabian Keßler

Reputation: 682

By looking into the reference of GCC , you will find -Wunused-function. But it only marks static or inline functions.

To mark member functions, you should take a look at clang, which can be a drop-in replacement for GCC. Clang offers -Wunused-member-function. https://clang.llvm.org/docs/DiagnosticsReference.html

Upvotes: 2

Related Questions