title: GCC -Wunused-function not working (but other warnings are working)
body: <p>I'm trying to find unused functions in my codebase by using GCC's <code>-Wunused-function</code> flag.</p>
  
  <p>As I would expect, compiling the below code with <code>gcc -Wall -Wunused-function main.cpp</code> prints an <code>unused variable</code> warning:</p>
  
  <pre><code>warning: unused variable ‘x’ [-Wunused-variable]
  </code></pre>
  
  <p>However, the compiler doesn't give an <code>unused-function</code> warning. 
  <strong>What do I have to do to make GCC notice the unused function <code>foo()</code>?</strong></p>
  
  <pre><code>// main.cpp
  
  void foo(){ } //should (but doesn't) trigger 'unused function' warning
  
  int main (int argc, char **argv){
      int x; //correctly triggers 'unused variable' warning
      return 0;
  }
  </code></pre>
  
  <p>Remember, I <strong>do want</strong> unused function warnings. This is <strong>not</strong> a "how do I get rid of warnings" question.</p>