title: Eclipse warning error for unused function
body: <p>I get a "unused static function" warning in Eclipse for code that looks like this:</p>
  
  <p>my.c:</p>
  
  <pre><code>static void myfunc(void) {  // This line gives unused warning.
     printf("in myfunc()");
  }
  typedef void(* myfunctyp)(void);
  
  #include "my_generated.h"
  </code></pre>
  
  <p>my_generated.h:</p>
  
  <pre><code>myfunctyp mylist[] = {
     myfunc,
     0
  }
  </code></pre>
  
  <p>my_generated.h is a generated code so I cannot just put the array in the .c file.</p>
  
  <p>My Questions are:</p>
  
  <ol>
  <li>How can I tell Eclipse to look into the include file so it can accurately determine that the function is used?</li>
  <li>If I cannot get #1, how can I add an indicator in the source code to tell eclipse that this particular warning is okay?  I am aware that I can change Window->Preferences->Code Analysis -> Unused Static Function configuration to eliminate the error, but I would like something that "sticks" with the source.</li>
  </ol>
  
  <p>[Edit (Addition)]: The function gets called in the main program like this:</p>
  
  <pre><code>mylist[0]();
  </code></pre>
  
  <p>If I move mylist[] declaration into the .c file, the warning error does not appear.</p>