title: Is function pointer address always static?
body: <p>If a function pointer scopes out before being used in another thread to run, will the pointer be invalid? Or are function pointers always valid since they point to executable code which doesn't "move around"?</p>
  
  <p>I think my real question is whether what the pointer points to (the function) will ever change, or is that value static throughout lifetime of program</p>
  
  <p>Pseudo-code:</p>
  
  <pre><code>static void func(void) { printf("hi\n"); }
  
  int main(void)
  {
      start_thread();
      {
          void (*f)(void) = func;
          // edit: void run_on_other_thread(void (*f)(void));
          run_on_other_thread(f); // non-blocking. 
      }
      join_thread();
  }
  </code></pre>