title: Detect unused functions in C
body: <p>I'm looking for a way to check if my C project, that compiles to an ELF, has unused functions, and locate them.
  That is functions that are declared but are not called anywhere in my code.</p>
  
  <p>The solution can be one of:</p>
  
  <ul>
  <li>A utility that goes through my .c files, analysing them</li>
  <li>A utility that goes through my compiled ELF file, that has symbols, analysing it statically</li>
  <li>A way to warn about unused functions in gcc (and -Wunused-functions doesn't do that for global functions)</li>
  </ul>
  
  <p>The solution cannot be one of:</p>
  
  <ul>
  <li>Deleting unused functions in compile time, without knowing what functions were deleted</li>
  <li>Analysing the ELF file in run-time, since not every function will be called in every run such as <code>gprof</code> (some functions take days until they are called, but in the code flow you can see that they are eventually called)</li>
  <li>A utility that discovers dead-code inside functions (i.e. code after a return from function), rather than unused functions</li>
  </ul>
  
  <p>Thank you</p>