title: Function pointer cast on function with inherited C structure
body: <p>I'm looking for answer if presented in a example function cast and call is valid in C(if not any example how to get similiar behavior would be nice).</p>
  <p>Example:</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdint.h&gt;
  
  typedef struct {
      uint32_t a;
  } parent_t;
  
  typedef struct {
      parent_t parent;
      uint32_t b;
  } child_t;
  
  
  typedef void (*funct_ptr_t)(parent_t* pParent, uint32_t x);
  
  void test_function(child_t* pChild, uint32_t x);
  
  int main()
  { 
      funct_ptr_t func = (funct_ptr_t)test_function;
      funct(NULL, 0U);
  
      return 0;
  }
  
  void test_function(child_t* pChild, uint32_t x) {
      // do something
  }
  </code></pre>
  <p>@EDIT
  As above turned to be invalid, i would like to also ask about second approach</p>
  <pre><code>typedef void (*funct_ptr_t)(void* pChild, uint32_t x);
  
  void test_function(child_t* pChild, uint32_t x);
  
  int main()
  { 
      funct_ptr_t func = (funct_ptr_t)test_function;
      child_t child;
      func(&amp;child, 0U);
  
      return 0;
  }
  
  void test_function(child_t* pChild, uint32_t x) {
      // do something
  }
  </code></pre>