title: Why I have to cast void pointer to int pointer before using its value?
body: <p>So I came across this situation today. I had a code like this</p>
  
  <pre><code>void some_handler(some_stuct_t * p_evt_type)
  {   
              uint16_t a = ((uint16_t )p_evt_type-&gt;p_instance-&gt;p_instance_handler);
              (a)++;
  }
  </code></pre>
  
  <p>It was givinig me warnings, but when I changed code to cast to pointer it looks like perfectly correct.</p>
  
  <pre><code>void some_handler(some_stuct_t * p_evt_type)
  {   
              uint16_t * a = ((uint16_t *)p_evt_type-&gt;p_instance-&gt;p_instance_handler);
              (*a)++;
  }
  </code></pre>
  
  <p>The </p>
  
  <pre><code>p_instance_handler
  </code></pre>
  
  <p>is of type </p>
  
  <pre><code>(void *)
  </code></pre>
  
  <p>What is wrong with casting directly to value ?</p>