title: Dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
body: <p>I'm really confused.</p>
  
  <pre><code>uint8_t hash[20];
  uint32_t u;
  
  // Setting hash to some value here...
  
  u = *(uint32_t*) hash;
  </code></pre>
  
  <p>This <code>*(uint32_t*) hash</code> causes a warning: </p>
  
  <p><code>Dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]</code>. </p>
  
  <p>I think it's something wrong in typecasting, but I'm not sure, because I don't clearly know on how <code>*(type*) var</code> way of typecasting actually works. It seem to point on an object with an asterisk inside too. I am confused, that's the thing which forces me to ask a question about that.
  Especially I'd like to know how <code>type*</code> differs from <code>*(type*)</code>. This may be a lot of help to get rid of this warning.
  Thanks in advance.</p>